Faster Rust ML code via benchmarks
Codex: Coding agents wrote Rust ML algorithms like UMAP from scratch, then iteratively optimized them against criterion benchmarks.
Each model pass added about 1.5x to 2.0x speedup, reaching roughly 7.5x to 32x over baseline; one implementation beat xgboost on speed.
Overview
How it was set up
Agents in Zed Agent with long Markdown prompts; Rust criterion benchmarks, faer, simsimd, rayon, PyO3 bindings, no unsafe code, quality checked against umap-learn.
Worth knowing
Optimizing against benchmarks can overfit to them; vague goals failed, and speed gains needed a quality check against a reference.
A prompt to start from
Run the CPU benchmarks first to set a True Performance Baseline. Then optimize the library code so all benchmarks run at least [1.2x] faster than baseline, without editing the benchmarks or adding unsafe code. Repeat until results stop improving, reporting relative speedup after each iteration.Written by Agentic Feats from the source. Not the author's exact prompt.
Sources 1
History
- Source published
- 2026-09-21
- Added to Agentic Feats
- 2026-10-13
- Pick
- No
- Markdown copy
- /c/faster-rust-ml-code-via-benchmarks-codex.md
More in coding
68 featsResultA live blog aggregator pulling posts from Dev.to, AWS Community Builders, Bravo LT and RedMonk, built and deployed in a single day.
ResultA live MVP website for the podcast and newsletter went up after about 10 hours of struggling to load it on a custom URL.
ResultWithin one night Devin produced a working unanswered-emails interface using the Gmail API, after the author wrote the authentication code themselves.