Re:Wc2: Investigates optimizing 'wc', the Unix word count pr...
by kllrnohj on Thursday June 20, 2024 @10:14PM
(#40745521)
Run a profiler on your code sometime and see how many branches it reports taking. You can easily get millions of branches per second, so 1% events happen hundreds of thousands of times.
See for example this quick investigation and look at the number of branches for what's not a very big program https://bnikolic.co.uk/blog/hpc-perf-branchprediction