Skip to content

Use Ninja for faster build#233

Merged
1a1a11a merged 3 commits into1a1a11a:developfrom
haochengxia:hxia/ninja
Jun 27, 2025
Merged

Use Ninja for faster build#233
1a1a11a merged 3 commits into1a1a11a:developfrom
haochengxia:hxia/ninja

Conversation

@haochengxia
Copy link
Copy Markdown
Collaborator

@haochengxia haochengxia commented Jun 25, 2025

For a faster build speed, propose to use Ninja as the generator of cmake.

Build.yml time cost: 2m49s -> 2m25s

@1a1a11a
Copy link
Copy Markdown
Owner

1a1a11a commented Jun 26, 2025

Should I merge it?

@haochengxia
Copy link
Copy Markdown
Collaborator Author

Should I merge it?

I am afraid not. Want to have more test and script optimization before merge.

@1a1a11a
Copy link
Copy Markdown
Owner

1a1a11a commented Jun 26, 2025

Should I merge it?

I am afraid not. Want to have more test and script optimization before merge.

Sounds good. I added -j to make and it also speeds up a lot, but ninja is also a good option.

@haochengxia
Copy link
Copy Markdown
Collaborator Author

haochengxia commented Jun 26, 2025

I see. Parallel compilation helps a lot. Want to try Ninja after witnessing a lot of modern projects use it. And if our codebase continuously grows it may become more useful.

@haochengxia haochengxia marked this pull request as ready for review June 27, 2025 00:53
@haochengxia haochengxia requested a review from Copilot June 27, 2025 00:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR switches the CMake generator and build tool from Make to Ninja across all scripts, CI workflows, and example READMEs to improve build performance.

  • Add -G Ninja to CMake invocations
  • Replace make and cmake --build calls with ninja
  • Install ninja-build (or ninja) in setup scripts and CI jobs

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/setup_hooks.sh Configure temporary lint build with Ninja
scripts/install_libcachesim.sh Use Ninja instead of make
scripts/install_dev_dependency.sh Install ninja-build/ninja packages
scripts/install_dependency.sh Add Ninja to Ubuntu/Homebrew installs
scripts/debug.sh Build debug target with Ninja
example/*/README.md Update example build steps to use Ninja
README.md Change root build instructions to Ninja
.github/workflows/*.yml Install Ninja in CI and use ninja
Comments suppressed due to low confidence (2)

README.md:124

  • Since the build instructions now rely on Ninja, consider adding a prerequisite note instructing users to install Ninja (e.g., sudo apt install ninja-build or brew install ninja).
cmake -G Ninja .. && ninja

example/plugin_v2/README.md:18

  • Add a brief prerequisite section or comment to remind users to install Ninja before running these commands.
cmake -G Ninja ..

@1a1a11a
Copy link
Copy Markdown
Owner

1a1a11a commented Jun 27, 2025

LGTM

@1a1a11a 1a1a11a merged commit fed3a36 into 1a1a11a:develop Jun 27, 2025
5 checks passed
@haochengxia haochengxia deleted the hxia/ninja branch June 27, 2025 03:05
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