Skip to content
Hacker News front page

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 published the prompts and benchmark results behind agent-driven Rust optimization, hitting 2x to 20x faster than mature libraries on algorithms like UMAP with unsafe code banned.

Read the original ↗Export Markdown