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

Use Ninja for BoringSSL if available #837

Merged
merged 5 commits into from
May 30, 2021

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented May 29, 2021

Ninja build tool significantly reduces compilation time for BoringSSL in default configuration.

This is mostly due to the fact that it performs parallel builds by default but there are other gains (Makefiles that CMake generates are not that optimal). make -j4 is also a viable option, but it often ends up brittle.

Timings for my machine

As you can see, there is some gain in wall clock time (real), resulting in shorter builds. However, this comes mostly from better parallelization if you look at the user time.

time make ENGINE=boringssl

master:

real	4m30.623s
user	3m32.624s
sys	0m33.530s

with ninja:

real	2m47.085s
user	4m47.580s
sys	0m34.020s

time emmake make wasmthemis

master:

real	2m59.856s
user	2m14.338s
sys	0m29.650s

with ninja:

real	1m57.756s
user	3m13.189s
sys	0m33.403s
Timings for GitHub Actions

It's always nice to see builds run a bit quicker.

master:

Test set Job Step Time
Themis Core Unit tests (ubuntu) Build Themis Core (BoringSSL) 3m 09s
Themis Core Unit tests (macos) Build Themis Core (BoringSSL) 6m 57s
Themis Core Memory leaks Build Themis Core 4m 22s
WasmThemis Unit tests (16.x) Build WasmThemis 2m 34s

with ninja:

Test set Job Step Time
Themis Core Unit tests (ubuntu) Build Themis Core (BoringSSL) 2m 33s
Themis Core Unit tests (macos) Build Themis Core (BoringSSL) 2m 26s
Themis Core Memory leaks Build Themis Core 2m 48s
WasmThemis Unit tests (16.x) Build WasmThemis 1m 45s

Checklist

  • Change is covered by automated tests
  • Benchmark results are attached (if applicable)
  • The coding guidelines are followed
  • Public API has proper documentation
  • Changelog is updated

Look into the system if there is "ninja" binary available in PATH.
If there is one, note it for future use.
Ninja build tool significantly reduces compilation time for BoringSSL in
default configuration. This is mostly due to the fact that it performs
parallel builds by default but there are other gains (Makefiles that
CMake generates are not that optimal). "make -j4" is also a viable
option, but it often ends up brittle.
Make sure it's actually installed where relevant.
@ilammy ilammy added the infrastructure Automated building and packaging label May 29, 2021
@ilammy ilammy merged commit 6834dbd into cossacklabs:master May 30, 2021
@ilammy ilammy deleted the tsumaranai-ninja branch May 30, 2021 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Automated building and packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants