Writing Rust code that's fast by asking agents to make the code faster
A developer shows agentic models, including Claude Opus 4.5, can iteratively optimize Rust for 2x-20x speedups.
A developer reports that modern coding agents can iteratively rewrite Rust until benchmarks stop improving, producing large speedups. Using Claude Opus 4.5, and earlier Claude Sonnet 3.5, the author reimplemented UMAP in Rust with PyO3 bindings while forbidding unsafe code. Guardrailed prompts, criterion benchmarks, and libraries such as faer and simsimd yielded roughly 2x to 20x gains depending on the domain. Prompts and benchmark results are included.
50