---
title: "VESPA: Static profiling for binary optimization"
description: "VESPA (Vintage ESP Amended) lets the BOLT binary optimizer run without dynamic profiling by predicting branch probabilities statically."
url: "https://swe.quest/articles/vespa-static-profiling-for-binary-optimization-e63042c42d2a6f6d"
canonical: "https://engineering.fb.com/2022/03/15/developer-tools/vespa/"
source: "Meta Engineering"
published: "2022-03-15"
difficulty: "hard"
kind: "Research"
reading_minutes: 3
tags: ["compilers","performance","machine-learning"]
---

# VESPA: Static profiling for binary optimization

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2022-03-15, 3 min read, Research. Original: [https://engineering.fb.com/2022/03/15/developer-tools/vespa/](https://engineering.fb.com/2022/03/15/developer-tools/vespa/)

## Summary

VESPA (Vintage ESP Amended) lets the BOLT binary optimizer run without dynamic profiling by predicting branch probabilities statically. A neural network is trained on applications with known dynamic profiles, using features such as branch condition codes and whether the target block is a loop header. Its predicted probabilities are converted into code frequency estimates that BOLT consumes as if they were real profiles. Compared with the original ESP technique, VESPA adds an improved model, new program features, and the derivation of frequencies rather than just branch directions. Integrated into BOLT, it delivers about a 6% speedup on top of Clang -O3 binaries, versus roughly 20% with real profiles, which makes binary optimization viable where profiling is impossible, such as mobile apps.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Compilers](https://swe.quest/tags/compilers.md) (Compilers & runtimes)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)

## Prerequisites

- profile-guided optimization ([easy posts on Performance engineering](https://swe.quest/tags/performance.md?difficulty=easy))
- branch prediction basics
- binary optimizers

## Keywords

VESPA, BOLT, LLVM, evidence-based static prediction, Clang

## Related posts

- [From hand-tuned Go to self-optimizing code: Building BitsEvolve](https://swe.quest/articles/from-hand-tuned-go-to-self-optimizing-code-building-bitsevolve-65732e9f0f979e91.md): Datadog Engineering · 2025-09-18 · Medium · 17 min read · Performance engineering, Go, AI agents, Cost optimization, Compilers
  Datadog cut CPU in Go hot paths by removing compiler bounds checks in NormalizeTag (25% faster, 0.75% service CPU) and adding an ASCII fast path to NormalizeTagArbTagValue (90% faster, hundreds of thousands of dollars in projected annual savings), guided by production data showing nearly all inputs were ASCII.
- [Faster Assisted Generation with Dynamic Speculation](https://swe.quest/articles/faster-assisted-generation-with-dynamic-speculation-d8a65fbd607c86ac.md): Hugging Face · 2024-10-08 · Medium · 7 min read · Inference & serving, LLMs, Performance engineering
  Dynamic speculative decoding stops the draft model's token generation as soon as its softmax confidence falls below a threshold (assistant\_confidence\_threshold), rather than always drafting a fixed or heuristically adjusted number of tokens before verification by the target model.
- [Auditing in the age of (good enough) AI](https://swe.quest/articles/auditing-in-the-age-of-good-enough-ai-790bce56b92999e7.md): Trail of Bits · 2026-09-18 · Hard · 10 min read · Static analysis, Formal methods, Cryptography, AI agents, Vulnerability research
  Before auditing the Miden zero-knowledge VM, Trail of Bits spent six months using Claude and Codex agents to build tooling for its custom stack-based assembly language (MASM): an LSP server, a decompiler with a reusable IR, an abstract-interpretation static analysis engine, and a Lean model of the VM executor.
- [Adding the V8 CPU Profiler to v8go](https://swe.quest/articles/adding-the-v8-cpu-profiler-to-v8go-57f5c1c58134c15f.md): Shopify Engineering · 2022-03-04 · Medium · 10 min read · Go, Performance engineering, API design, Runtimes & VMs, JavaScript
  Exposing V8's CPU profiler through v8go, the Go library for running JavaScript in V8 isolates via Cgo, came down to a choice between lazily fetching each profile node property with its own Cgo call or eagerly building the whole call tree in C++ and rebuilding it in Go from a single pointer.
- [Strobelight: A profiling service built on open source technology](https://swe.quest/articles/strobelight-a-profiling-service-built-on-open-source-technology-6a094fead0e4b62a.md): Meta Engineering · 2025-01-21 · Medium · 12 min read · Performance engineering, Observability, Linux, Cost optimization, Compilers
  Strobelight is Meta's fleet-wide profiling orchestrator, running 42 profilers (mostly eBPF-based, plus ad-hoc bpftrace scripts) on every production host with safeguards against PMU counter conflicts, concurrency limits and queuing.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
