logoalt Hacker News

deepsun • today at 2:36 PM • 1 reply • view on HN

> What would be needed is some sort of compatibility switch that disables all optional CPU features. Sure, you will get some reduced performance of the compiled code, but in exchange, a faster startup time.

I think other AOT-compiled languages don't opt in for the lowest set of CPU features -- they just detect them at runtime and use whenever present, all in compiled machine code.


Replies

mikepurvis • today at 2:40 PM

It's normally an opt-in thing I think, since it's not an unconditional win: you have to figure out which code paths are worth it, and then where to trade off binary bloat vs the runtime cost of dynamic dispatch. In rust for example:

https://doc.rust-lang.org/beta/core/arch/#dynamic-cpu-featur...