-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
test_runner: run single test file benchmark #56479
base: main
Are you sure you want to change the base?
test_runner: run single test file benchmark #56479
Conversation
Review requested:
|
Is there any benefit to using worker threads in the test runner? My guess is that there isn't. Worker threads will be slower than no isolation, have less isolation than child processes, and a number of Node APIs either don't work, or work differently in worker threads. |
I agree on the "somewhere in between offering limited benefits" The only significant advantage I see is the overhead reduction. I've experimented with a poc and the reduction seems to be decent but not incredible on a large test suite. My idea would be to start with an isolation based on a "single worker" moving incrementally then to a "pool" of workers. |
I'm not opposed to supporting a pool, but I still think worker threads are not a great choice due to API differences. FWIW, you might find these benchmarks interesting. |
Thanks @cjihrig for the link! I've taken a quick look and I think I'll extend this bench 😁
On this point, are you thinking about a pool of processes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
On this point, are you thinking about a pool of processes?
I think that would be less surprising to users, albeit not as performant as using worker threads. No matter which approach you take, you'll also have to deal with certain edge cases. For example, only
tests will require the --test-only
flag. There might also be edge cases related to watch mode.
622ddbc
to
0fe0976
Compare
With reference to #55723:
As I'm exploring the possibility of adding a new kind of isolation (worker thread), I think we should add at least one benchmark to measure the differences in overhead between various isolation methods.
For example, I would expect a worker thread to have less computational overhead than a process.
This benchmark is meant to trace and highlight these kinds of differences