3 ms·
Zapcc can, and frequently does, speed up the compilation of single files by 20x or more in the incremental case. CCache can't do that. And it's by far the commo
by modeless 1y ago
Zapcc can, and frequently does, speed up the compilation of single files by 20x or more in the incremental case. CCache can't do that. And it's by far the common case when compiling iteratively during development. A speedup that large is transformational to your development workflow.
- wakawaka28 1y agoccache speeds up compilation of single files by quite a lot, by effectively avoiding unnecessary recompilation. There are distributed caches that work like ccache too. Compiling a file for a second or fiftieth time with no changes because of doing a clean build is the absolute most common case. Maybe zapcc does additional caching of compiler internal state, but I would have to look into it to see if it's actually good enough. Also, ccache works with many compilers, whereas zapcc is its own compiler. That is a huge advantage.
- jhasse 1y agoI have a cpp file that takes 10 seconds to compile. I change one line. How does ccache help me in this case?
- wakawaka28 1y agoWhen you do a clean build, it will pull that output from the cache if it has been compiled before and has not changed since. It does not technically speed up compilation of files. It bypasses compilation when it can.
- account42 1y agoccache does not speed up compilation at all, in fact it slows it down. It only speeds up re-compilation of the same translation unit (as in, bitwise identical preprocessed source code) which is often not all that useful, especially when the local development rebuild use case is already covered by make.
- wakawaka28 1y agoccache hardly slows anything down. It is a thin wrapper around running the compiler. You seem to kind of understand how it works, but it has multiple configurable ways to detect whether a file should be compiled. It does a LOT more than make, which does NOTHING to handle clean rebuilds or multiple builds of similar code in different locations. Unlike make, it does not rely on file timestamps alone to decide whether to rebuild an output.
- Too 1y agoThe readme does a really bad job of explaining this. They are also using the wrong metrics. What’s really interesting is time to incrementally recompile after changing one header file in $LARGE_PROJECT. Single file compilation sounds like an artificial measurement and isn’t exactly painful with normal clang today. Full build measurements are rather irrelevant in a project with proper incremental setup, or even ccache. Not that I would say no to faster full builds :)