calling cmake from meson is much slower
See original GitHub issueWhen using meson from master instead of 0.55.3, meson build --wipe becomes much slower.
On a small/medium size project with multiple subprojects, around 100 targets and a few external commands:
0.55.3
windows : 5.3s linux : 3.3s
master
windows : 13s linux : 4.7s
I’m particularly concerned with the windows evolution.
Running with cProfile I get this top offender
ncalls tottime percall cumtime percall filename:lineno(function)
436 10.685 0.025 10.685 0.025 {method 'acquire' of '_thread.lock' objects}
while on 0.55.3
ncalls tottime percall cumtime percall filename:lineno(function)
596 4.284 0.007 4.284 0.007 {method 'acquire' of '_thread.lock' objects}
and pyinstrument shows me that nearly all this time is spent calling cmake (which I use to acquire external dependencies).
A git bisect led me to find this comes from 7e58f33376119b53e01616139ad9354ce9cfe003. Notifying @mensinda
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Is Meson really faster than CMake? : r/programming
The article compares both CMake and Meson using the Ninja backends. In fact, the ninja step was a little faster for him on...
Read more >FAQ
Why is there not a Make backend? Because Make is slow. This is not an implementation issue, Make simply can not be made...
Read more >Skipping CMake compiler checks - Usage
The problem is that CMake invokes the compiler for each dependency multiple times to gather data. This is naturally fine for configuring a...
Read more >More Modern CMake - GitHub Pages
You should pick a tool on your first CMake call in a directory, just like the compiler. Feel free to have several build...
Read more >Using via meson — NumPy v1.24 Manual
We will need the generated C wrapper before we can use a general purpose build system like meson . We will acquire this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For reference, I have opened https://discourse.cmake.org/t/skipping-cmake-compiler-checks/2079 to figure out a proper soultion.
@mensinda Tested your suggestion, it’s faster at ~7s with
no generatorinstead of ~10s (my first measurement at 13s was a bit high, maybe cold filesystem or something).