-
Notifications
You must be signed in to change notification settings - Fork 2k
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 & update nodejs data for Performance
interface
#25007
base: main
Are you sure you want to change the base?
Conversation
}, | ||
{ | ||
"version_added": "8.5.0", | ||
"partial_implementation": true, | ||
"notes": "Exported from the <code>perf_hooks</code> module" | ||
"notes": "Only available as an internal instance." |
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.
How could users interact with this interface, if it wasn't exported prior to 18.8.0?
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.
though the interface can't be accessed directly, but it can be accessed via performance
property: require('perf_hooks').performance.__proto__.constructor
performance.__proto__.constructor === Performance
will report true
in latest node
Summary
the exact version of when the
Performance
class is exposed to global is not mentioned (only mentioned theperformance
global property)in node v19.0.0, while other performance related features has been exposed via nodejs/node#44483, the
Performance
interface has been exposed yet;in node v16.0.0, only
performance
global proeprty is exposed to global via nodejs/node#37970;in node v18.8.0, here the
Performance
interface is exposed to global via nodejs/node#44220, before this version, it is only available as an internal instance.Test results and supporting details
https://nodejs.org/docs/latest/api/globals.html#performance
https://nodejs.org/docs/latest/api/perf_hooks.html#perf_hooksperformance
Related issues