-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use an alternative to Bluebird in forked threads. #393
Comments
Hmm... Seems like a great idea. And we don't even have to load anything if there's already a native promise. Want me to have a go at implementing this? |
Yep, use
Lets get consensus with the plan first. |
Long stack traces might be a good reason to keep Bluebird around. See #394. |
Just to chime in from the sidelines, I see two quick points in favor of keeping it:
Granted, point 2 doesn't hold for everyone and at some point in time there may be a mismatch between my version of bluebird and ava's. But it's not uncommon and something to keep in mind. |
I don't think it's worth dropping Bluebird. Long stack traces are very useful, especially when it comes to testing. 50ms is a long time for just require & parsing though. Might be worth looking more closely into why it takes so long. Maybe there's something we could do to improve it or at least open an issue on the Bluebird issue tracker about it. |
Nothing jumps out: https://gist.github.com/jamestalmage/873252568d8487bb1d95 |
I was thinking using https://github.com/s-a/iron-node flame graphs to see what actually slows down the loading. Maybe something in Bluebird could be made lazy. |
Yes, but if you create this: // index.js
require('time-require');
require('./foo.js'); // foo.js
require('bluebird'); you get this:
The output is cumulative of the require time for everything you require, plus your time to eval and return. While bluebird itself takes a long time, everything it |
I just tried that, I am not finding it super useful either.
My only thought would be "make everything lazy". |
How does #394 help with long stack traces? Presumably this only helps us if there is a crash in the test worker? Is it meant to help debug crashes in before/after hooks? Other than that it helpfully enables long stack traces for users who also rely on If the stack traces are useful for end-users then we should close this issue IMO. |
With #390 -
bluebird
is now %37 of our load time according totime-require
. It takes about50ms
on my machine (w/ fast SSD's).pinkie
takes <=1ms
to load on the same machine.It seems like we mostly use the
bluebird
bells and whistles in the main thread. When it comes to forks, I think our only use of abluebird
specific API is here.I wrote this simple benchmark (It is really naive, I know):
On my machine the break even point is
80 ms
, at which point both implementations have completed just about6,000
cycles of the above loop. We now create at least one promise for each assertion, and a couple per test. Still, it is hard to imagine any reasonable test file generating the 6,000+ promises necessary to break even usingbluebird
.The text was updated successfully, but these errors were encountered: