r/Compilers • u/BrainThinkerMan • 24d ago
Compilers add or remove perfomace?
isnt it that compilers change the code, as in not only transferring it into machine language, but before that changing the structure of the code. so how would one attempt to make performant code if the compiler changes sed code that i tried to make performant?
2
Upvotes
View all comments
Show parent comment
18
u/kniy 24d ago
AST is not really suitable for optimizations. Compilers generally have additional intermediate representations specifically for optimizations.
So it's more like: