Profile-Guided Optimization (PGO) state for TinyGo compiler #4643
Replies: 1 comment
-
I did not. It would indeed be an interesting optimization, though there are also other things that are not nearly as efficient as they could be (most importantly, the step where all LLVM modules are merged together and optimized as a whole - it's been a long term goal of mine to get rid of that step). I'm also not sure easy it would be to do this in CI, where we currently build our binaries.
It's an interesting question indeed! I have not investigated this. I think there is still a lot of low hanging fruit regarding traditional optimization work (especially the heap/GC) so I'm not sure it's worth it yet to focus on PGO since PGO is much more involved. But feel free to experiment! |
Beta Was this translation helpful? Give feedback.
-
Hi!
Here I want to discuss two questions regarding the Profile-Guided Optimization (PGO) state in TinyGo.
The first question is about optimizing the TinyGo compiler itself with PGO. Did anyone perform such experiments? According to my tests, PGO allows to achieve 10-15% compilation speed improvement for compilers and similar tooling. If such tests were performed, could you please share the results?
The second question is about supporting PGO in the TinyGo compiler. PGO support was added to the main Go compiler in the 1.20 version (1.21 in a GA state). According to multiple tests, PGO allows to achieve better performance for Go applications too so having this optimization in TinyGo may be beneficial for its targets too (like software running on microcontrollers). Did you discuss an idea about implementing PGO support in TinyGo (probably based on LLVM features since many LLVM-based compilers support PGO like Clang, Rustc). I tried to find this information in the documentation and other resources but found nothing.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions