r/Compilers • • Oct 17 '26

code optimization

ive seen that compiler middle end optimized code,

how do i optimize that code without the compiler; and then the

compiler takes less time doing it for me.

ie; i change some loops to be better, and change ome if statments to add less conditions

0 Upvotes

2 comments sorted by

View all comments

1

u/adityazero Oct 21 '26

One should generally focus on readability and maintenance when writing code. Only start doing optimizations when they become bottleneck. There is place for what you are thinking but not everywhere because it usually makes code harder to read.