mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #749] [Improvement] Parallelization for faster build time #587
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#587
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HattDroid on GitHub (Jun 13, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/749
Hi,
Thanks for barrier, that is a great and really useful tool.
Not really an issue but a small tip that I think doesn't deserve a pull request.
I am building barrier quite often on my Linux system and found the process slow.
I just added the '-j' to 'make' in order to take into account parallelization on multi core machines.
Build time did not get divided by the number of cores on my machine (the code must have a lot of inter dependency I guess and the configure part is still serialized code), but it still got reduce from 2m49,402s to 0m50,226s.
Please find a diff with the latest commit below and attached if you want to merge it.
parallel_barrier_build.txt
@shymega commented on GitHub (Jun 13, 2020):
This needs to be a PR. Please submit as a PR. Happy to let you know how, if you don't already know.
Issues are for bug reports and other issues really -- not code enhancements/additions.
Closing for the moment.
@p12tic commented on GitHub (Jun 13, 2020):
One thing to know is that there's no
nprocon macOS and we useclean_build.shthere. So this change can't be applied as is.@shymega commented on GitHub (Jun 13, 2020):
Also this.
@shymega commented on GitHub (Jun 13, 2020):
Although, just thinking, could we get cmake to inject the
-jargument based on the amount of CPU cores on the build host?@HattDroid commented on GitHub (Jun 14, 2020):
Thanks for all the sensible details guys. Make sense not to adopt it out of the box.
Thanks shymega to be willing to help with how to PR.
Found this command to find the number of cores on a MacOS machine:
sysctl -n hw.ncpuAnyone with a Mac could try it and let know? It seems to report a wrong value on my Mac VM.
About getting cmake to populate the number of available threads, I am not sure make or cmake are aware of the number of cores, or that it's part of their ambitions.
I know that running 'make -j' without specifying the number of cores will spawn the max number of compilation threads it can to build a project.
This could fit as an alternative working on all platforms.
At the end of the day the hardware will limit you in both cases and you end up around the same time as using nproc to use all of your cores/vcores.
@simons-public commented on GitHub (Jun 14, 2020):
@HattDroid I can confirm
sysctl -n hw.ncpuworks on my physical mac.