aras-p / ClangBuildAnalyzer

Clang build analysis tool using -ftime-trace
The Unlicense
1.01k stars 65 forks source link

Wall-clock vs CPU clock #28

Open pitrou opened 4 years ago

pitrou commented 4 years ago

While looking at the clang patch that added -ftime-trace, I noticed that it uses std::chrono::steady_clock. That is most certainly a wall clock, not a CPU clock. That means the numbers obtained when running a parallel build (which is almost unavoidable on a large project) may be unreliable, depending on scheduling. Did you consider this issue?

ben-craig commented 4 years ago

I would argue that all times are unreliable. CPU or user time can still be unreliable just based off of what the rest of the system is doing.

If you are concerned about reproducible timings, then you can collect timings with a -j1 build