Prompting agents to iteratively optimize Rust until it beats state-of-the-art libraries
Writing Rust code that's fast by asking agents to make the code faster
Max Woolf spent over a year testing whether agentic LLMs can iteratively optimize Rust code with a hard pass/fail rule: each iteration must deliver at least a 5% speedup or roll back. With Claude Opus 4.5 and later models, he got 2–20× speedups on algorithms like UMAP versus mature libraries, all without unsafe code. The post includes the exact prompts and benchmark results. The caveat: these gains are measured on his specific benchmarks and may not translate directly to production workloads.
Why it matters: Max Woolf spent a year validating a concrete agentic-iteration loop for Rust optimization with a hard ≥5% speedup rule, reproducible benchmarks against mature libraries, and zero unsafe code. The post includes prompts and results — a rare first-person experiment with numbers. ...