website/content/en/docs/administration/optimization/pgo.md
Profile-Guided Optimization (PGO) is a compiler optimization technique where a program is optimized based on the runtime profile.
According to the tests, we see improvements of up to 15% more processed log events per second on some Vector workloads. The performance benefits depend on your typical workload - you can get better or worse results.
More information about PGO in Vector you can read in the corresponding GitHub issue.
There are two major kinds of PGO: Instrumentation and Sampling (also known as AutoFDO). In this guide, is described the Instrumentation PGO with Vector. In this guide we use cargo-pgo for building Vector with PGO.
cargo pgo build. It will build the instrumented Vector version.cargo pgo run -- -- -c vector.toml and wait for some time to collect enough information from your workload. Usually, waiting several minutes is enough (but your case can be different).target/pgo-profiles directory.cargo pgo optimize. It will build Vector with PGO optimization.A more detailed guide on how to apply PGO is in the Rust documentation.