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
Object constructor calls are slow #3629
Comments
callViaObject looks seriously slow. However not sure its popularity. Do you have v8 numbers? |
Yes. Check the blog in the description of this issue. |
I tried playing with his code a bit:
The reason for our poor callDirect score is that warmup wasn’t sufficient for us. Running the warmup twice, we get:
I then used a switch to get rid of the polymorphic calls:
Our numbers make sense here, but not sure what happened to Chrome… We have some pretty easy optimizations (allowing non-fixed field inlining checks to be hoisted our of lops) that should speed up all of these significantly. Inlining Object() would certainly help the second case and we should look into it. It should be easy. Firefox has pretty consistent results across all 3 runs:
|
Awesome. Note however that the polymorphic call site inside |
There was a discussion going on in webpack/webpack#5600 that wraps all references into
Object ()
which was slow. v8 recently fixed it and I piggy-backed the test case from here that was used to demonstrate v8's behavior and verified forchakracore
and the results are similar. We are slow too and will be good to optimize to get boost inwebpack
module.Results :
The text was updated successfully, but these errors were encountered: