TL;DR
Benchmarking the C compiler antcc revealed that its optimized builds were unexpectedly 1.4x slower than non-optimized ones, likely due to aggressive inlining causing code bloat.
✦ Why It Matters
Review and adjust inlining strategies in your compiler to prevent performance issues.
Key Takeaways
Full Summary
While testing the performance of the C compiler antcc with a Lua benchmark, the author discovered that the optimized builds were significantly slower than expected, specifically 1.4 times slower. This was surprising given that antcc implements few optimizations, with inlining being one of the most impactful.
The initial hypothesis suggested that the inlining heuristics might be too aggressive, leading to increased code size and poor instruction cache performance. Disabling inlining confirmed this theory, as the performance improved.
The size of the optimized build was approximately 43KB, which was about 2.4 times larger than the non-optimized version. This raises concerns about the effectiveness of the current inlining strategy and highlights the need for better tuning to avoid performance degradation.
Related