New benchmark runner: Afterframe #1254
krausest
announced in
Announcements
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So far the CPU benchmark measured duration by looking at the chrome timeline traces (the events one can see in the performance tab). This restricted testing to chrome only with the drivers: webdriver (selenium), puppeteer, playwright and webdriver-cdp.
If we want to measure across browsers we have to measure on the client side, since safari and firefox seem to have no api to access something similar like timeline tracing. We had some functionality in the benchmarks that tried to do client side measuring for the duration in the past: (the commit for its removal was 89b546f).
https://github.com/andrewiggins/afterframe takes a similar approach to get a callback after the rendering finished by using aMessageChannel and RAF.
It would be interesting to add such a benchmark driver and see if we can achieve cross browser testing.
The two classes to implement that are https://github.com/krausest/js-framework-benchmark/blob/master/webdriver-ts/src/benchmarksWebdriverAfterframe.ts and https://github.com/krausest/js-framework-benchmark/blob/master/webdriver-ts/src/forkedBenchmarkRunnerWebdriverAfterframe.ts. The test driver injects the afterframe code into the loaded page to compute the duration for the operation. This is similar to the other benchmark drivers where the whole duration from the click to finishing the repainting is measured.
Beta Was this translation helpful? Give feedback.
All reactions