-
Notifications
You must be signed in to change notification settings - Fork 5.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
(fix): performance.now() should be a minimal op to avoid JSON deserialization overhead #8619
Conversation
A million iterations Minimal OP
JSON OP
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Soremwar looks good!
Removing the extra Uint8array actually made a big difference :O New times:Minimal OP v1 (Extra Uint8Array)performance.now - Time elapsed: 2335 ms Minimal OP v2 (Clean)performance.now - Time elapsed: 1677 ms JSON OPperformance.now - Time elapsed: 5906 ms |
Stll quite slow compared to Node, I might look inside to check what magic they are doing to achieve those results, but for all practical purposes this is solved |
@Soremwar Node.js uses V8 fast API calls (nodejs/node#33600). I have a proof-of-concept in denoland/rusty_v8#511 but it's not anywhere near ready. |
Yeah, so this improvement is great for now until we can support fast API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @Soremwar - LGTM
This is a very encouraging example of why we should support FastAPI. Ultimately it would be awesome if all of our ops could use it.
Closes #8548