Commit graph

2 commits

Author SHA1 Message Date
Bartek Iwańczuk
02404333f1
fix(ext/node): add back perf_hooks.markResourceTiming (#29562)
Adding back a sham for "perf_hooks.markResourceTiming" that was removed
by accident in https://github.com/denoland/deno/pull/29323; a test was
added too, to ensure it doesn't regress in the future.

Closes https://github.com/denoland/deno/issues/29539
2025-06-02 17:53:38 +05:30
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