|
|
|
|
|
by dataangel
1302 days ago
|
|
They’re nowhere near free. Branch prediction table has finite entries, instruction cache has finite size, autovectorizing is broken by bounds checks, inlining (the most important optimization) doesn’t trigger if functions are too big because of the added bounds checking code, etc. This is just not great benchmarking — no effort to control for noise. |
|
This is the big one. You pay a 50% penalty for actual CPU bound, iteration heavy code with bounds checking enabled.
https://github.com/matklad/bounds-check-cost