-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Adding caching for this._isFulfilled(). On an app I tested it in, the av... #505
Conversation
… average time for Promise._settlePromiseAt() was 12ms, with that change, going down to 7ms, and total, going down from 900ms to 760ms, so about 18% performance increase
…s significantly faster than the current observe being used as well as faster than timeout. It’s also a whole lot more backward compatible then MutationObserver. I would suggest to remove the observe based schedule entirely, but left it there for you to review. On my Macbook Pro, Chrome 40, on https://github.com/montagejs/popcorn load, Async.drainQueues goes from 1.7ms self (~1158.3 ms total) to 0.3 ms self (~547.1 ms total). Promise._settlePromiseAt goes from 12.9 ms self (~1147.1 ms total) to 7.8 ms self (~ 762.1 ms total)
All test passed with node tools/test |
First about the scheduler, MessageChannel is unacceptable because it is bugged in some browsers. If this is ok for your application then you can use I cannot see any difference from the isFulfilled caching alone, testing in node 0.12 |
Promise.setScheduler, excellent, works like a charm, well done. I’m focusing tests on client, and especially mobile, it matters there. If there’s no difference on node than sounds like a win to me.
|
I don't have a mobile to test but if we are gonna do this we can do much better. We can load the bitfield once and use a macros like |
…ck, will use custom setScheduler instead
…, conditional place where it is used.
That sounds great!
|
@marchant you should develop against 3.0 (the coming release) and not against master fwiw. |
Ok, thanks, I'll have to figure out how to do the browser build then!
|
|
Thanks, appreciated!
|
What is 3.0 bringing?
|
|
@marchant also:
|
Outdated example of warnings: http://imgur.com/a/t3xng (constructor return is removed now and several new ones are added that are not in the album) |
...erage time for Promise._settlePromiseAt() was 12ms, with that change, going down to 7ms, and total, going down from 900ms to 760ms, so about 18% performance increase