Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse dom-testing-library in same execution context #69

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

andrewiggins
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

don't send entire library on each evaluation
1 participant