-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
CPU usage of runtests.py #1071
Comments
I don't see similar high variability on my Linux desktop when using up to 4 parallel processes (4 cores, 8 threads, Intel Core i7 2600K, stock clock, Ubuntu 14.04):
But see what happens when I try -j8:
My guess is that you were running this on a 2-core CPU with 4 threads -- then increasing parallelism from 2 to 4 would only give small benefits, similar to me going from 4 to 8 parallel processes. I also checked that I got almost linear scaling up to -j2 on my dual-core Retina Macbook Pro but then only minimal improvements as expected. |
Yes, I have only two cores (poor me :-). It still surprises me but I guess
this is overhead due to excessive switching between cores. Oh well. Never
mind me.
|
Core i7 typically has 4/8 logical cores ("threads" in marketing materials) vs 2/4 physical cores. The reason for what you saw seems to be that every core actually slows down when all the logical cores are being utilized (as the extra "logical cores" are sharing physical CPU resources with another logical core using the same physical core). So, when using high levels of parallelism the reported CPU time is higher because all cores run slower. As there are more things running in parallel, the perceived performance is usually still better, but not as much as when having a large number of real CPU cores. |
When @gnprice added the -j flag, I tried
runtests.py lint
with a few different -j settings and found that the more parallellism, the more CPU it used (also less real time, but that was more expected ;-). I wrote down some timings in #1066 (comment), repeated here:-j4
-j2 (default)
-j1
Is there some busy-waiting going on somewhere?
The text was updated successfully, but these errors were encountered: