Warp: Facebook Open-Sources A Super Fast C/C++ Pre-Processor
Following Facebook's announcement of the Hack language and being one of the organizations backing the new WebScaleSQL, Facebook developers ended out last week by announcing Warp, their latest open-source contribution.
Warp is a C/C++ pre-processor that aims to be as fast as possible. The Warp pre-processor aims to be much faster than GCC's pre-processor. As explained in a new Facebook post:
Warp is a C/C++ pre-processor that aims to be as fast as possible. The Warp pre-processor aims to be much faster than GCC's pre-processor. As explained in a new Facebook post:
Conventional wisdom has it that preprocessing time is a negligible part of building a C++ binary. C++ is notoriously difficult to parse, which means that C++ parsers tend to be large and slow compared to their counterparts for other languages. Code generation is also quite the time sink, especially if you're using optimizations. Finally, linking is a large serial step at the end of each build, and using the gold linker only helps so much. Therefore, it would seem that the lowly task of going through the included files and expanding macros would take a comparatively short time and be essentially impossible to improve upon.The code to the Warp pre-processor has been open-sourced via GitHub. Those wishing to learn more about this C/C++ pre-processor can find details at length via the Facebook post announcement.
Not so! Replacing gcc's preprocessor with warp has led to significant improvements of our end-to-end build times (including linking). Depending on a variety of circumstances, we measured debug build speed improvements ranging from 10% all the way to 40%, all in complex projects with massive codebases and many dependencies. That's not per-file speed, but rather global times measured for scenarios like "build after changing a header file."
20 Comments