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

I’m not sure why someone of facebook’s scale would want JIT instead of AOT. That’s a lot of servers all JITing the same thing that could be done once at build time.



Facebook actually does some compile-time optimizations, but also ships some of the profiling data for JITing between early deploy phases and the rest of the fleet: https://engineering.fb.com/2021/03/03/developer-tools/hhvm-j...

Also, Facebook used to do ahead of time compilation (HPHPc) but eventually HHVM managed to outperform it.


JIT compilation has the opportunity to do profile-guided optimization at runtime. JIT compilation is also simpler when distributing an application to non-identical servers, as it can optimize for the exact hardware it is running on.


HHVM's predecessor at FB was an AOT PHP to C++ transpiler called HPHPc. There are a lot more optimization opportunities with JIT compilation when dealing with dynamically typed languages like PHP.


Because they first tried to AOT, and a 2nd project with a JIT managed to get better performance out of it, with improved development workflow.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: