Skip to content
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

validate.sh: --jobs should default to nproc #10315

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

9999years
Copy link
Collaborator

If nproc is available and --jobs is not given, this will use the output of nproc as the value for --jobs.

Otherwise, the old default value of 4 will be used and a warning will be printed.

The default value of 4 has remained unchanged since it was added in 6a9a101 in 2018; that may have been a reasonable number of cores then, but my development machine today has 20 cores, so setting the parallelism to 4 leaves a lot of performance on the table!

@geekosaur
Copy link
Collaborator

I have 16 cores, but I also have quite a lot going on on my machine and would prefer validates not interfere. I think the idea of 4 is a reasonable default that can be overridden depending on environment.

@9999years
Copy link
Collaborator Author

@geekosaur Sure, I don't think we should remove the --jobs option. But there's a reason the concurrency of virtually every program defaults to the number of physical cores — the operating system's scheduler is quite good at figuring out what's most important. With concurrency less than the number of physical cores, we don't give the scheduler the opportunity to do that.

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable default especially due to its wide adoption (from my experience). Thank you.

validate.sh Show resolved Hide resolved
@9999years 9999years added the merge me Tell Mergify Bot to merge label Sep 6, 2024
@mergify mergify bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days labels Sep 6, 2024
If `nproc` is available and `--jobs` is not given, this will use the
output of `nproc` as the value for `--jobs`.

Otherwise, the old default value of 4 will be used and a warning will be
printed.

The default value of 4 has remained unchanged since it was added in
6a9a101 in 2018; that may have been a
reasonable number of cores then, but my development machine today has 20
cores, so setting the parallelism to 4 leaves a lot of performance on
the table!
@Mikolaj Mikolaj force-pushed the validate-jobs-nproc branch from 6b9bacf to 00c9b65 Compare September 8, 2024 17:25
@mergify mergify bot merged commit 437bf5a into haskell:master Sep 8, 2024
49 checks passed
@geekosaur
Copy link
Collaborator

@mergify backport 3.12

Copy link
Contributor

mergify bot commented Sep 14, 2024

backport 3.12

✅ Backports have been created

mergify bot added a commit that referenced this pull request Sep 14, 2024
validate.sh: `--jobs` should default to `nproc` (backport #10315)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants