TLDR Web Dev · MISCELLANEOUS

GOING FASTER BY DUPLICATING CODE

voidstar.tech9 min read

Summary from the TLDR Web Dev newsletter

There’s a unique programming technique to optimize code by introducing conditional branches based on runtime values. This author provides multiple examples of the technique in practice, showing how it can improve code performance. This technique works because compilers are able to perform better optimizations based on expected runtime values, which isn’t possible with traditional constant-based optimizations.