Facebook Is JIT'ing C++ Code To Treat It Like A Crazy Fast Scripting Language
Facebook has worked on various programming language innovations over the years from all their work on HHVM at a time when PHP was slow to working on a super fast C/C++ pre-processor to other open-source language work. Their latest work in this area is on supporting just-in-time compilation of C++ code to treat it like a scripting language.
It turns out Facebook is already using JIT'ed C++ code in production as their own "efficient scripting framework" for dealing with their HTTP request handling logic in their L7 reverse proxies. Their C++ scripts are compiled/linked/executed at run-time and built off the LLVM/Clang infrastructure.
Over other scripting languages, they turned to making this C++ script in order to offer better debugging, profiling, and ultimately run-time performance compared to other scripting languages. But, yes, there is the slight increase in initial start-up time but the actual run-time performance appears to be meeting their needs.
Facebook engineers say their C++ scripting framework was faster than another previously used scripting language by four times. This isn't straight-up unmodified C++ sources they are JIT'ing but are relying upon pre-compiled headers and other changes to suit their workflow/requirements.
LLVM/Clang does the heavy lifting but sadly this C++ scripting framework doesn't appear to be open-source at least not yet. Facebook engineers briefly presented on this work during this month's EuroLLVM conference in Brussels.
It turns out Facebook is already using JIT'ed C++ code in production as their own "efficient scripting framework" for dealing with their HTTP request handling logic in their L7 reverse proxies. Their C++ scripts are compiled/linked/executed at run-time and built off the LLVM/Clang infrastructure.
Over other scripting languages, they turned to making this C++ script in order to offer better debugging, profiling, and ultimately run-time performance compared to other scripting languages. But, yes, there is the slight increase in initial start-up time but the actual run-time performance appears to be meeting their needs.
Facebook engineers say their C++ scripting framework was faster than another previously used scripting language by four times. This isn't straight-up unmodified C++ sources they are JIT'ing but are relying upon pre-compiled headers and other changes to suit their workflow/requirements.
LLVM/Clang does the heavy lifting but sadly this C++ scripting framework doesn't appear to be open-source at least not yet. Facebook engineers briefly presented on this work during this month's EuroLLVM conference in Brussels.
28 Comments