Node.js 18.8.0 supported Performance interface#25007
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.
How could users interact with this interface, if it wasn't exported prior to 18.8.0?
There was a problem hiding this comment.
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
and another reason is that there is a rule which force parent feature' version must not be greater or equal than child feature's version
see also #25001 (comment) and #24998 (comment)
There was a problem hiding this comment.
it can be accessed via
performanceproperty:require('perf_hooks').performance.__proto__.constructor
Should we mention this explicitly? I feel like the previous note was somewhat more informative.
| "notes": "Only available as an internal instance." | |
| "notes": "Only available as an internal instance (`require('perf_hooks').performance.__proto__.constructor`)." |
There was a problem hiding this comment.
@skyclouds2001 What do you think about this suggestion? 👆
There was a problem hiding this comment.
I think the info of how to access the interface is not required, as in most case user will not access this interface directly but use its properites and methods; and since the info is only for old node.js version, very fewer user will use it.
|
This pull request has merge conflicts that must be resolved before it can be merged. |
Performance interfacePerformance interface
Summary
the exact version of when the
Performanceclass is exposed to global is not mentioned (only mentioned theperformanceglobal property)in node v19.0.0, while other performance related features has been exposed via nodejs/node#44483, the
Performanceinterface has been exposed yet;in node v16.0.0, only
performanceglobal proeprty is exposed to global via nodejs/node#37970;in node v18.8.0, here the
Performanceinterface 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