pptr-testing-library icon indicating copy to clipboard operation
pptr-testing-library copied to clipboard

Reuse dom-testing-library in same execution context

Open andrewiggins opened this issue 3 years ago • 0 comments

Hello! 👋

This PR fixes #1 by only copying dom-testing-library to a puppeteer execution context if it doesn't already exist. This change improves performance significantly in my benchmarks.

base x 22.98 ops/sec ±9.53% (55 runs sampled)
latest x 586 ops/sec ±10.48% (58 runs sampled)
querySelector x 1,102 ops/sec ±12.93% (50 runs sampled)
Fastest is querySelector

It also adds the simple benchmark I used to validate the change improved performance.

Closes #1

andrewiggins avatar Apr 20 '22 18:04 andrewiggins