Remix.run Logo
▲ afdbcreid a day ago

> 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.

▲DannyBee a day ago | parent | next [-]

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

▲afdbcreid a day ago | parent [-]

You can always not enable PGO of course. What I meant is that I don't expect NativeAOT to do better.

▲jasomill 18 hours ago | parent | prev [-]

True, but there's no reason PGO can't eventually be implemented for native AOT.

Microsoft already has both dynamic PGO in .NET JIT and traditional PGO in its C++ toolchain, after all.

And for that matter, there's no reason LLVM itself couldn't eventually be a target for native AOT.

▲afdbcreid 15 hours ago | parent [-]

> True, but there's no reason PGO can't eventually be implemented for native AOT.

It already is implemented, I believe. The thing I wondered is how NativeAOT could be faster, which is what GP claimed.

(Also, practically it should be slower because NativeAOT is based on the JIT and the JIT is worse at optimizing than LLVM).