3 ms·
Fair. But having worked on both and currently working on AOT I'd say I should be biased for AOT not against it... Startup time/warmup is obviously a well known
by invalidname 11y ago
Fair. But having worked on both and currently working on AOT I'd say I should be biased for AOT not against it...
Startup time/warmup is obviously a well known JIT weakness but if its well written its just really hard to beat. E.g.
if(x) { invokeMethodX() } else { invokeMethodY() }
Say x is related to user details/preferences and for a specific install will never change... AOT can't do anything about that...
JIT can inline invokeMethodX() then optimize across methods and eliminate the if altogether. This isn't some theoretical exercise... Its stuff that exists today in JIT's. AOT provides consistency which is a good thing, you can write low level code (e.g. C can be handcoded to a level that's pretty great) so I'm mostly talking about higher level languages (Java etc.).
- richardwhiuk 11y agoAOT can do most of that as well - see likely() annotations. And it's highly unlikely the JIT can get rid of the if entirely - it needs to check that it's assumptions hold true, otherwise it needs to drop out into the none-JITted code.
- strcat 11y agoProfile-guided optimization exists and is used by projects like Firefox is the real world. The advantage of JIT compilers is getting the profiling data dynamically, but that's usually going to be worse off than a well-tuned profiling suite especially if there are manual annotations.