-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat: use a single 'performance' global #29323
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
feat: use a single 'performance' global #29323
Conversation
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.
Temporary solution - I'm not yet sure if we should have two separate files that implement and contribute to "performance" global - ATM I think "yes", because this file uses additional classes that are not available in the "Web" version, but it is to be seen.
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.
I expect several WPT tests to fail
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.
LGTM
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.
LGTM
This commit changes how "performance" global is handled -
instead of having separate "performance" globals for user and npm
code, we now have a single implementation.
This implementation is a de facto Node.js implementation - ie. it contains
additional properties compared to the "Web" implementation.
The two global can be compared using these docs sites:
The benefit of this change is that when you use
performance.now()
in atight loop, the actual runtime of the code significantly improves - this is
because the
performance
global doesn't have to be "looked up" anddecided which is to be used, the "Web" or the "Node.js" version.