Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

waterfall performance #40

Closed
scriby opened this issue Jun 13, 2011 · 2 comments
Closed

waterfall performance #40

scriby opened this issue Jun 13, 2011 · 2 comments

Comments

@scriby
Copy link

scriby commented Jun 13, 2011

I did some performance testing and noticed that waterfall has quite a bit more overhead than series (about 5x). I would guess it's because it uses nextTick between each step in the waterfall.

Is nextTick there to prevent the call stack from growing out of control? I think you can call the next step directly, but keep track of how many calls have been made in the waterfall, and once it reaches are certain point (around 50?), dispatch the next call using nextTick. That should reduce the overhead associated with nextTick and still prevent the call stack from growing out of control.

@bitwiseman
Copy link

The line referred to is https://github.com/caolan/async/blob/master/lib/async.js#L494 . Is scriby's thought about callstack depth the reasoning here? Also, has anyone compared the performance of nextTick for immediate?

@caolan caolan closed this as completed Mar 28, 2014
@alizbazar
Copy link

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:

alizbazar@gmail.com
Domain alizweb.com has exceeded the max emails per hour (129/120 (107%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext2.iad.github.net ([192.30.252.193]:44943 helo=github-smtp2b-ext-cp1-prd.iad.github.net)
by web107.webhotelli.fi with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
(Exim 4.82)
(envelope-from noreply@github.com)
id 1WTaNH-0003bq-Du
for alizbazar@alizweb.com; Fri, 28 Mar 2014 19:15:23 +0200
Date: Fri, 28 Mar 2014 10:15:22 -0700
From: Caolan McMahon notifications@github.com
Reply-To: caolan/async reply@reply.github.com
To: caolan/async async@noreply.github.com
Message-ID: caolan/async/issue/40/issue_event/106554091@github.com
In-Reply-To: caolan/async/issues/40@github.com
References: caolan/async/issues/40@github.com
Subject: Re: [async] waterfall performance (#40)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5335ae2a6a4ed_7cc23f992bedf2c01193d5";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Recipient: alizbazar
List-ID: caolan/async <async.caolan.github.com>
List-Archive: https://github.com/caolan/async
List-Post: mailto:reply@reply.github.com
List-Unsubscribe: mailto:unsub+i-1051723-e45c8daa4155871c81d5f501ddc3642ab155c1eb-736771@reply.github.com,
https://github.com/notifications/unsubscribe/736771__eyJzY29wZSI6Ik5ld3NpZXM6TXV0ZSIsImV4cGlyZXMiOjE3MTE2NDYxMjIsImRhdGEiOnsiaWQiOjIwNTk5MjE0fX0=--c483416fe7315896b7b380af9ea2bf6d2315422a
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: alizbazar@alizweb.com

----==_mimepart_5335ae2a6a4ed_7cc23f992bedf2c01193d5
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #40.


Reply to this email directly or view it on GitHub:
#40
----==_mimepart_5335ae2a6a4ed_7cc23f992bedf2c01193d5
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #40.


Reply to this email directly or view it on GitHub.

----==_mimepart_5335ae2a6a4ed_7cc23f992bedf2c01193d5--

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants