You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
To benchmark key performance metrics of libraries one needs to execute test cases in a Worker thread to disable JIT compiler optimizations. In my case, I am benchmarking the parsing performance of different ECMAScript parsers. While benchmark.js allows for deferred execution of test cases, it measures the elapsed time of the entire run (including setting up a Worker, loading libraries, etc.). There must be a way to only measure the key metrics such as parsing performance in a Worker thread.
Proposed Solution
Let deferred.resolve() specify the elapsed time as deferred.resolve({elapsed: elapsed}). Also expose the timing routines of benchmark.js to be included in a worker thread if that is deemed necessary.
Workaround
Currently the following workaround works with some limitations.
deferred.resolve();
deferred.benchmark.minTime = 0;
deferred.elapsed = event.elapsed; // from worker
The main side effect of this workaround is that each cycle has a single run of a test case (which probably is inadequate for some cases?). In my case, I am measuring the elapsed time in the worker using the high resolution timer available as performance.now().
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Use Case
To benchmark key performance metrics of libraries one needs to execute test cases in a Worker thread to disable JIT compiler optimizations. In my case, I am benchmarking the parsing performance of different ECMAScript parsers. While benchmark.js allows for deferred execution of test cases, it measures the elapsed time of the entire run (including setting up a Worker, loading libraries, etc.). There must be a way to only measure the key metrics such as parsing performance in a Worker thread.
Proposed Solution
Let
deferred.resolve()
specify the elapsed time asdeferred.resolve({elapsed: elapsed})
. Also expose the timing routines of benchmark.js to be included in a worker thread if that is deemed necessary.Workaround
Currently the following workaround works with some limitations.
The main side effect of this workaround is that each cycle has a single run of a test case (which probably is inadequate for some cases?). In my case, I am measuring the elapsed time in the worker using the high resolution timer available as
performance.now()
.The text was updated successfully, but these errors were encountered: