Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

eachSeries performance regression from 1.2.x to 1.3.x #15

Closed
goldfire opened this issue Aug 17, 2015 · 3 comments
Closed

eachSeries performance regression from 1.2.x to 1.3.x #15

goldfire opened this issue Aug 17, 2015 · 3 comments

Comments

@goldfire
Copy link

I haven't had a chance to look through and figure out what has changed with eachSeries between 1.2.x and 1.3.x, but I have noticed there is a severe performance regression (to the point of it being unusable). It is easily reproducible with the following fiddles:

1.2.1 - http://jsfiddle.net/4vg8p84w/
1.3.2 - http://jsfiddle.net/j3r5az56/

@suguru03
Copy link
Owner

@goldfire
I'm sorry to reply late.
Your benchmark is very right.
On v1.3.x, series functions (eachSeries, eachLimit, series…) were changed to call async.nextTick at the tail of each iterator when the iterator was called synchronously (nextTick is not called in the whole of the iterator.) to avoid stack overflow even if developer does not care about it.
async v1.x is already changed it.

@xpiwo
Copy link

xpiwo commented Aug 24, 2015

looks like they plan to remove it. caolan/async#883

If the whole purpose of nextTick is just to prevent stack overflows, i think the detection should be several 'sync' in a row.

eg i have waterfall:

[async, async, async, sync_verify_result_is_valid, async, async, async...]

so should use nextTick only after X sync calls.

@suguru03
Copy link
Owner

I want to remove nextTick too.
But there are some cases that had occurred stack overflow by Async on production environment, I do not want to cause it.

On v2.x, I’m going to enable to select safe or fast. (default is safe)

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

No branches or pull requests

3 participants