-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Pick job count dynamically when -j0 is used #6543
base: main
Are you sure you want to change the base?
Conversation
BTW I also made a patch for treating |
Thanks for your contribution. This change was proposed before - see my previous comments on it here: #5326 (comment). |
Thanks for the quick response. I had been wondering what the #5326 in d064f9c refers to, since the trac issue under that ID is unrelated; I get it now! I came up with this PR because I am doing a C++ pipeline with a bunch of static analyzers and noticed that IMO anyone using If you decide that this is not a desirable feature, it might be good to replace the TODO. |
thanks I like to have similar behavior
I believe it's worth it. |
In that other comment firewave said that we don't want to check all files at once.. and I agree with that. |
@firewave you said that "std::thread::hardware_concurrency() might provide the desired information but it is implementation-dependent and any fallback would be extremely non-portable code which I would like to avoid." But my assumtion is that a non-zero value from |
I have more comments on this but I am currently having issues with my hands (among other things) making it hard to do any work. |
716004c
to
7571e73
Compare
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. @firewave do you still have more opinions?
well you can write a line in the release notes also. |
Yes. I keep forgetting about this...will reply later. |
Sorry for the late reply.
On a desktop it does not make sense as this is most likely to overload your machine. Not as badly as So I do not think this should be added. This never having come up before also supports this. On Linux and such you can easily get the desired value via
Yeah - that TODO should have never made it into the code. |
Resolves a TODO for the -j argument, making it more similar to the behavior of tools like make and ninja. Instead of aborting when the user requests "zero jobs", pick a job count which is appropriate for the current system.
7571e73
to
5dc3646
Compare
@pvutov do you actually intend to use this in CI? i.e. will this feature have some active use? Or did you mostly want to pick a simple task and contribute to Cppcheck?
yes I agree.
I think that a pretty good argument to add it is to make cppcheck interface more similar to run-clang-tidy and make |
I've already implemented my pipeline to call For CI, you write the pipeline once so it is not a big deal to hardcode a more complicated command like I think the more significant improvement is for the interactive workflow. @firewave does not like this use case but IMO it should be left to the user to know what they want. If the user calls with |
It is not that I do not like the use case. First it is rare and second I personally experienced the downside of it. The IDE I use introduced a default value for But this seems to come down to the applications involved. Invoking a Cppcheck Visual Studio build via CMake might render your whole system unresponsive because they have an So it is possible for the "interactive" use case are some additional things we need to address (maybe it is thread affinity or something else - I have not looked into what VS is doing). But this makes me think of some different but related. That modern concept of E/P cores. There is OS level scheduling for this (which is being tweaked all the time) but I wonder how that would know that a random application like Cppcheck should use P cores. Are there system-level configurations or hints the application would provide? Something possibly to look into now that all three major CPU groups will use configuration coming end of July... |
Resolves a TODO for the -j argument, making it more similar to the behavior of tools like make and ninja. Instead of aborting when the user requests "zero jobs", pick a job count which is appropriate for the current system.