-
Notifications
You must be signed in to change notification settings - Fork 178
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
V8 disables optimization for dispatch #67
Comments
I forgot to mention you need to run the test using the following command:
|
Yep, I've seen this. I don't entirely trust the jsperf myself.... what I do notice though is messages in the browser that signal.dispatch is being skipped by the v8 optimizer. Some of the other github issue I listed above seam to think it can be significant. |
Sure, looking at the real outcome of the vm is the key for optimizing the
right way.
|
Looks like Array.prototype.push.apply is not subject deoptimization and is decently fast so the following should work too:
|
Still slower than the loop I think... but surprisingly does appear to allow v8 optimization. |
Fix for issue millermedeiros#67
Not that surprising. When you think about it, second argument of Oh Arrays and their dark magic performances...
|
Maybe can do even better. Apparently the one time you should can use |
@Hypercubed, from what I understand your library doesn't allow for a binding to have its own prepended/saved params. Regardless, the |
You're right. In both cases v8 optimization works because of |
As described in various places online (for example nodejs/node-v0.x-archive#6631 and bevry/taskgroup#12) v8 disables optimization when the "
arguments
variable being passed to other functions and disables optimization for any calling method doing so".I verified using the following test code:
The output includes:
If I replace #L366 with:
I would submit a PR but:
The text was updated successfully, but these errors were encountered: