cargo-pgo
cargo-pgo copied to clipboard
what kind of optimizations can it do?
I'm curious if it can for example reduce vtable cost?
I want to write my code using dyn traits even if there is only one implementation used actually (alternate impl for tests) but I also don't want to do too much generics (which could avoid vtables but it's a way more typing and it's not possible to use it for everything)
LLVM's PGO is what is relied on here, and it should be unable to reduce the dynamic dispatch overhead.
My understanding is that PGO is able to reorder / change the structure of branches to cooperate better with the branch predictor and (maybe) change some memory layout details, both based on recorded access / branch patterns. I don't think it can do much else.