-
-
Notifications
You must be signed in to change notification settings - Fork 670
Add option to run compiler tests in parallel #873
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
Conversation
I wonder how this different with |
From what I can tell so far this can be speed up by reducing the number of workers from 16 to 8, matching the number of physical cores, at least on my setup (from 17 to 14 seconds) and by running the std/math and std/typedarray tests, which take the most time, first (from 14 to 12 seconds). |
Try also numWorkers = physicalCores - 1. |
Ah, right. That's 0.5 seconds faster than half the physical cores :) |
Last commit brings it down to 13 seconds without reordering tests. |
From a node profile and a CPU profile I learned that most time is spent in either I/O, compiling a JS file, running the compiler or inside of Binaryen, while all cores spike at 100% at first with some dropping earlier than others. That's most likely because the remaining few long-running tests need to finish while some cores are already idle. I also found that running a non-parallel test utilizes one core at 100% and four at about 40%, so some stuff inside of node/V8 is threaded even in this case, even though the process presents itself as single-threaded. Explains why it's not a NUM_CORES times speedup. |
What if replace this to |
Does that work in node? If you want, feel free to improve this even more :) |
wait) I'm totally forgot that node.js does't support |
But we still have async |
Suggesting to merge this as-is so everyone can try it on their machines, potentially submitting additional improvements. It's not enabled on CI yet, so that should be fine. Wdyt? |
sure. Let's do it) |
Given the
--parallel
option, the compiler test suite can now spawn one process per logical CPU core and split the tests among them. The goal was to make this 100% interchangeable with a normal run, producing the same output except test ordering. Reduces the time ofnpm run test:compiler
from 32 to1713 seconds on my machine using167 workers.