Facebook Is JIT'ing C++ Code To Treat It Like A Crazy Fast Scripting Language

Written by Michael Larabel in Programming on 28 April 2019 at 08:01 AM EDT. 28 Comments
PROGRAMMING
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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week