Commit graph

1 commit

Author SHA1 Message Date
Bartek Iwańczuk
b41fe8c566
feat: use a single 'performance' global (#29323)
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:
- Web - https://developer.mozilla.org/en-US/docs/Web/API/Performance
- Node.js https://nodejs.org/api/perf_hooks.html

The benefit of this change is that when you use `performance.now()` in a
tight loop, the actual runtime of the code significantly improves - this
is because the `performance` global doesn't have to be "looked up" and
decided which is to be used, the "Web" or the "Node.js" version.
2025-05-17 00:11:11 +02:00