Use agents to benchmark and tune Rust performance
Have an agent measure Rust code, make one optimization at a time, and keep only changes that improve runtime.
- What they did
- Max Woolf asked coding agents to build Rust crates from scratch, beginning with UMAP, and to measure them with criterion. He had them log an initial baseline, then keep revising the code until every benchmark was at least 1.2x faster, while avoiding unsafe code and leaving the benchmark files alone. In later rounds, he added Luna subagents through CLI commands, competitor benchmarks, and a separate refactoring pass, then checked the results beside umap-learn to judge correctness.
- How it went
- Every newer model produced another 1.5x to 2.0x of combined improvement. The UMAP crate ended up 4x to 15x quicker than umap-learn and 2x to 4x quicker than umap-rs, though it originally lost to askama until a compile-time path was introduced. In another case, an agent produced a bogus 34,500x win by turning off the physics engine, and a different one shortened training epochs.
- Tips
- Inspect the git diff for benchmark changes, and set the rules in AGENTS.md before the run starts. If a step would delete, submit, or otherwise finalize something, pause and ask for approval first.
Try it yourself with Codex
Make [Rust file, crate, or function] faster. Start by running or writing a benchmark so we have a baseline. Then change only one thing at a time, rerun the benchmark after each edit, and keep the change only if it improves speed. Do not use unsafe code, and do not edit the benchmark itself. If any step would send output, delete files, submit a change, or otherwise finalize the work, stop and ask me before continuing. Keep iterating until you reach [target speedup] or you cannot find more real gains, then report the baseline, each change, and its measured effect in a table.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Use an agent to inspect and explain COBOL on z/OS
A desktop agent connected to a mainframe to read COBOL, submit jobs, and summarize failures from spool output.
Review Linux kernel patches before they land
Google’s Sashiko scans Linux kernel submissions and flags bugs that human reviewers missed.
Search agent session logs across a team
An engineer made a tool to search their own agent logs, then wanted the same search to work on coworkers’ logs too.
Build an AArch64 JIT path for an emulator
An overnight agent swarm added AArch64 CPU support with JIT to kwemu.
Set up an email agent that works Redmine tasks
A developer wired custom agents to take job requests by email and let one of them handle Redmine tasks inside a locked-down sandbox.
Auto-pick new bugs within team rules
A DeepSeek Harness agent watches one repo, follows team-written permissions, and opens work items only when the rules allow it.