My test system is an aging laptop, with an Intel Core i5-2410M CPU. It runs Debian Stretch with a fast SATA ssd with an ext4 filesystem on it.
I timed compilation of a c++14 source tree with roughly 60000 lines of code. This project is very relevant to me and is a mix of c with classes with more modern code.
Compilation from scratchThe exact commandline is
rm -rf * && ccache --clear --clean && cmake .. -GNinja && time ninja
When I run it three times in a row I get
with the original system (without the mitigation, kernel 4.9.65-3+deb9u1).
The patched system (kernel 4.9.65-3+deb9u2) gives:
The total time (real) is smaller than the repeatability. The system time (time spent in the kernel) increased with approx. 5%.
Compilation with hot cacheThis time I did not clear the ccache. The command line is
rm -rf * && cmake -GNinja .. && time ninja
With the original system, I get for three consecutive runs
With the patched system, I get:
Now when most of the work consists of getting cached results instead of compiling, a slowdown on the total time is noticed. It seems to be approximately 0.8 seconds which is 6% slower. I imagine this is the worst case.