-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Concurrency turning out useless on codebase & machine #2525
Comments
Wow, that's incredible, thanks for reporting an issue. I wonder if the overhead of pickling the results back to the workers is too big at this point, we'll have to switch our approach for the parallel runner if that's the case. |
I've observing this too (OS X, i7 processor).
|
I found Pylint got a lot faster by removing concurrency ( A concrete project has 134k LOC across 1662 Python files and a Pylint run across all the files dropped from 3m 33s to 1m 30s on average on a MBP dual core (with HT). CPU utilisation also dropped to less than half according to CPU time. I wonder if there's any cases where running Pylint concurrently is helping, or if it would be better to disable the feature for now? |
Some results on Windows 10 2004, Intel 9850H 6 cores/12 threads 32 bit pylinting matplotlib. pylint --version
cloc matplotlib
Running pylint with the default configuration;
|
@owillebo thank for the data, I think intuitively it makes sense that the optimal is 6 threads on a 6 core machine. Apparently this bug is not affecting you. |
Thanks,
I think utilizing all (12) available threads and halving the time for
running Pylint is a good thing.
Burning threads is a waste of time and resources. I think this bug is
affecting more than myself (which is indeed of less importance).
…On Sun, Sep 27, 2020, 17:11 Pierre Sassoulas ***@***.***> wrote:
@owillebo <https://github.com/owillebo> thank for the data, I think
intuitively it makes sense that the optimal is 6 threads on a 6 core
machine. Apparently this bug is not affecting you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2525 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXQ4KTGMDEX5PHGESTNQYDSH5IZTANCNFSM4FXU6BDQ>
.
|
Indeed, hyperthreading can lead to better use of the underlying hardware, but if there are no significant stalls (or both hyperthreads are stalled in similar ways) and all the threads are competing for the same underlying units the hyperthreads are just going to sequentially use the same resources. And the can is so conditional that, given the security issues of their implementation, Intel is actually moving away from HT: the 9th gen only uses HT at the very high end (i9) and very low (Celeron) ends, none of the 9th gen i3, i5 and i7 supports hyperthreading. |
If I run two pylint sessions concurrently each with 6 jobs and another half
of the matplotlib files, the wall clock duration drops from 65 seconds (for
all files in 1 session) down to 60 seconds. Indeed my threads don't bring
much.
…On Mon, 28 Sep 2020 at 10:10, xmo-odoo ***@***.***> wrote:
@owillebo <https://github.com/owillebo> thank for the data, I think
intuitively it makes sense that the optimal is 6 threads on a 6 core
machine. Apparently this bug is not affecting you.
Indeed, hyperthreading *can* lead to better use of the underlying
hardware, but if there are no significant stalls (or both hyperthreads are
stalled in similar ways) and all the threads are competing for the same
underlying units the hyperthreads are just going to sequentially use the
same resources.
And the *can* is so conditional that, given the security issues of their
implementation, Intel is actually moving away from HT: the 9th gen only
uses HT at the very high end (i9) and very low (Celeron) ends, none of the
9th gen i3, i5 and i7 supports hyperthreading.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2525 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXQ4KW3NK6KZODBTEDKV43SIBAGDANCNFSM4FXU6BDQ>
.
|
#6978 (comment) is quite an interesting result. |
That is true but I think it's a different issue: in the original post the CPU% does grow pretty linearly with the number of workers, which indicates that the core issue isn't a startup stall (#6978 shows clear CPU usage dips). |
Also FWIW I've re-run pylint on the original project, though only on a subset (as I think the old run was on 1.x, and pylint has slowed a fair bit in the meantime, plus the project has grown). This is on an 4 cores 8 threads Linux machine (not macOS this time), Python 3.8.12, 2.14.5. The subsection I linted is 71kLOC in 400 files. The results are as follow:
|
On M1 Macs, on large codebases, |
@olivierlefloch I don't think that can be solved by pylint (or any other auto-worker program): a while back I tried to see if the stdlib had a way to know real cores (as opposed to vcores / hyper threads) due to the comment preceding yours and didn't find one. I don't remember seeing anything for efficiency/performance either. I think the best solution would be to run under a bespoke hardware layout (make it so pylint can only see an enumerated set of cores of your choice), but I don't know if macos supports this locally (I don't remember something similar to linux's Also it doesn't seem like e.g. |
Seems since we move to new builder setup (weaker machines, 4 executors) CI jobs were stuck on pre-commit pylint stage taking 100% and timing out the 15min we gave for precommit stage seem like usin `-j 1` remove stop of the load on the CPU and even finishes faster Ref: pylint-dev/pylint#2525
This is on a codebase with 260kLOC across ~3600 files (python-only, according to
tokei
), on a 2010 MBP (2 cores 2 HT) running OSX 10.11, under Python 3.6.6 from macportsUsing
-j
with a number of jobs different from 1 significantly increases CPU consumption (~90%/core), but yields no improvement in wallclock time:Not sure what other informations to provide.
The text was updated successfully, but these errors were encountered: