Compiler Performance and LLVM

Compiler Performance and LLVM

Let’s begin with the Cone compiler design choices made for performance:

C. Choosing any systems language (C++, Rust, D) will likely result in measurably faster programs. Essentially, the compiler’s code generation stage builds binary LLVM IR from the Cone IR, asks LLVM to verify and optimize it, and then has LLVM generate an object file for the appropriate target CPU architecture. Similar to the front-end benchmarks shown above, I measured the elapsed-time for various LLVM-based backend stages, processing the same small Cone program:

Before we can talk about what these numbers mean, let’s sketch out the high-level algorithmic work each stage performs:

I want to be very careful when talking about LLVM and performance.

Source: pling.jondgoodwin.com