Skip to content

perf_hooks: reduce overhead of new resource timings

Continuing the work started on https://github.com/nodejs/performance/issues/109.

This PR should be landed after #49803.

                                                         confidence improvement accuracy (*)    (**)   (***)
perf_hooks/resourcetiming.js observe='resource' n=100000        ***   1086.23 %      ±40.80% ±54.98% ±72.99%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 1 comparisons, you can thus
expect the following amount of false-positive results:
  0.05 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.01 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)

I want to use the symbol kSkipThrow in other classes around the NodeJS codebase, someone had some idea where I should put it? Or create a new symbol and reuse it when possible?

Right now, we have this symbol being used on perf_hooks but there is also an identical symbol on webstreams, so maybe we can put it in a higher module and import it around the node, I initially thought to put it inside errors, since we will always use it together with ERR_ILLEGAL_CONSTRUCTOR.

I will reuse the same symbol only when it inherits some class that exports a symbol, otherwise, I will create a new one.

/cc @nodejs/performance

Merge request reports

Loading