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

Parallel compilation #118

Closed
wants to merge 1 commit into from
Closed

Conversation

dentiny
Copy link

@dentiny dentiny commented Dec 2, 2024

When I am building duckpgq, I found compilation only takes one single core, which is pretty slow.
This PR attempts to add parallel build option in the make option, which leverages all CPU cores.

Let me know if you have better suggestions :)

@carlopi
Copy link
Collaborator

carlopi commented Dec 2, 2024

Usually parallelism is achieved when enabling ninja as GENERATOR, but I am not sure if this is propagated correctly.

Which platform are you seeing not have parallel compilation enabled?
(It might be that there are places where this is not propagated correctly)

@dentiny
Copy link
Author

dentiny commented Dec 3, 2024

Hi @carlopi, thanks for the reply!

I'm following the build steps in pgq, which simply prompts me to make without extra dependency installed.

I confirmed I have ninja and cmake installed

(base) ubuntu@hjiang-devbox-pg:~/duckpgq-extension$ ninja --version
1.10.1
(base) ubuntu@hjiang-devbox-pg:~/duckpgq-extension$ cmake --version
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

but simply make alone only leverages one single core, while my fix PR does parallelize.

Which platform are you seeing not have parallel compilation enabled?

ubuntu, x86_64

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  32
(base) ubuntu@hjiang-devbox-pg:~/duckpgq-extension$ uname -a
Linux hjiang-devbox-pg 6.2.0-1018-aws #18~22.04.1-Ubuntu SMP Wed Jan 10 22:54:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

If you have more formal ways for parallel compilation, maybe it's better to have a readme somewhere?

@dentiny
Copy link
Author

dentiny commented Dec 6, 2024

Hi @carlopi , kindly ping, I'm wondering if you have any thought on it?

@samansmink
Copy link
Collaborator

I agree we should pick up documenting the recommended use of Ninja (and ccache) to speed up compilation. There's an open issue for this here.

@samansmink samansmink closed this Dec 9, 2024
@dentiny
Copy link
Author

dentiny commented Dec 16, 2024

OK I figured out, you should make <debug> GEN=ninja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants