Skip to content

waterfall much slower than series #621

@elad

Description

@elad

Hello,

I've put the following in a file called async.html and opened it in Chrome:

<html>
    <head>
        <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/async/0.9.0/async.js"></script>
        <script type="text/javascript">
            function log(msg) {
                console.log((new Date).toISOString(), msg);
            }

            log('waterfall: start');
            async.waterfall([
                function(callback) {
                    log('waterfall: function');
                    callback();
                }
            ], function(err) {
                log('waterfall: finish');
            });

            log('series: start');
            async.series([
                function(callback) {
                    log('series: function');
                    callback();
                }
            ], function(err) {
                log('series: finish');
            });
        </script>
    </head>
</html>

The output in the console looks like:

2014-09-11T14:16:41.136Z waterfall: start async.html:6
2014-09-11T14:16:41.141Z series: start async.html:6
2014-09-11T14:16:41.141Z series: function async.html:6
2014-09-11T14:16:41.142Z series: finish async.html:6
2014-09-11T14:16:41.150Z waterfall: function async.html:6
2014-09-11T14:16:41.151Z waterfall: finish async.html:6

Note the delay between waterfall's "start" and "function" (14ms) vs. series' (0ms). In a real-world web app I have the waterfall delay is usually around 600ms. (!)

Is this a known issue, or even an issue at all? is there a reason for such a delay?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions