> and in some specific situations faster than Rust
I'm very curious to hear when? Because even the people that argue managed languages can be faster than unmanaged, say it because the JIT has better information at runtime. But NativeAOT cannot be better (and will be worse) than LLVM with PGO.
The last sentence is definitely true in the limit but not always in practice. PGO doesn’t always make good decisions. It should, but it doesn’t. Anyone who has ever used PGO has seen plenty of cases where PGO results in performance regressions versus non-PGO.
some of these are consistent enough that there are workloads where PGO does worse than non-PGO.
they can all be fixed, of course. which is why what you said is true in the limit, but it might not be true for right now