Day 17 of Advent of Compiler Optimisations!
A function that handles both upper and lower case conversion. Call it with upper=true and the compiler inlines it — but something remarkable happens. The inlined code doesn't just avoid the function call overhead. Half the function completely vanishes! How does copy-pasting code make it disappear?
Read more: https://xania.org/202512/17-inlining-the-ultimate-optimisation
Watch: https://youtu.be/JFHfFTvMPp0