3 ms·
> autovectorizing is broken by bounds checks This is the big one. You pay a 50% penalty for actual CPU bound, iteration heavy code with bounds checking enabled
by dahfizz 4y ago
> autovectorizing is broken by bounds checks
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 https://github.com/matklad/bounds-check-cost
- camkego 4y agoThis should be the article. Running this with 1.65 on an Intel 12400 gets a nearly 4x speedup when bounds checking is not needed. Just wow. Bounds checking avoidance is important when it becomes a significant chunk of your hot-path.
- zozbot234 4y agoThe proper way of addressing that is to manually hoist bound checks out of "hot" loops. Not just remove them altogether.