Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While you are right, the compiler should still definitely do most of the job. There's simply no reason to keep track of dependencies, etc. at run-time, instead of doing this compile-time.


Some of that information doesn't exist at compile time...


Do you have any examples of when this beats a C program compiles with `-march -O2`?

I've read about this promise of JIT optimization being able to generate optimal code on hot paths, but in practice I've never seen it work out that way. Good AOT compilers exist today and consistently generate optimized machine code.


Your C code is already executed by the CPU in a JIT optimized way because of the way the x86 architecture is implemented on the CPU. What more proof do you want?! :)


I don't exactly know what you're searching for, but I've heard of LuaJIT beating GCC, etc. in some rare cases.


I'm honestly searching for examples of a JIT beating an AOT because it had runtime information the AOT couldn't know.


How so? When the compiler generates code like add eax, eax add ebx, ebx Of course it knows that they are independent. They could then be represented in the ISA as a block of sorts.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: