Binary optimization without the profiling pass
Binary optimizers such as Meta's BOLT, part of the LLVM project, can deliver meaningful speedups for highly optimized binaries. The technique, however, traditionally depends on dynamic profile data collected from running the application with representative workloads. That dependency limits where the optimizer can be used—it complicates build pipelines and can be infeasible for software, like mobile apps, that runs on end-user devices.
In new research, Meta engineers propose VESPA (Vintage ESP Amended), a static profiling method that removes that dependency. VESPA builds on the earlier ESP (evidence-based static prediction) technique, which used machine learning to infer branch directions statically. VESPA extends that idea to produce richer profile information that existing binary optimizers can consume directly, without changing how they work internally.
From branch prediction to code frequencies
VESPA works in two stages. First, during a training phase, the system takes a set of applications paired with their dynamic profiles. A neural network learns to predict the probability that any given branch instruction will be taken based on program characteristics: the branch's condition code, or whether the target block is a loop header, for example. After training, the model can be applied to entirely new programs—no execution or dynamic profiling required.
But unlike its predecessor ESP, VESPA does not stop at branch probabilities. It converts those probabilities into code frequencies: estimates of how many times each block of code executes. This is the data shape binary optimizers such as BOLT normally require. Once VESPA injects this static profile into the optimizer, the optimization proceeds as if the profile had been collected by instrumented execution. The mode of profile generation is transparent to the tool.
Relative to ESP, VESPA contributes three specific changes:
- An enhanced neural-network model with better accuracy
- New program features fed into the model
- A method to derive full code frequencies rather than just branch directions
Gains where profiling is impossible
BOLT is known to achieve roughly 20 percent speedups on Meta's large-scale server workloads and on broadly used open source projects, including GCC, Clang, MySQL, and PostgreSQL. Those gains depend on accurate dynamic profiles, which are not always available or practical to generate. By delivering static profiles, VESPA aims to expand the range of applications that can be optimized.
The research demonstrates VESPA integrated into BOLT, claiming a 6 percent speedup over binaries already built with Clang's -O3, without any dynamic profiling step. The finding suggests that binary optimization can still be useful when profiling is impossible, opening the door to scenarios like optimizing end-user mobile applications where execution traces are simply inaccessible.



