Codex optimizes a Rust template engine
Max Woolf reports using Codex to build and iteratively benchmark a Rust template engine against established crates, then add a compile-time path after losing that comparison.
Original prompt
Shared by the source author. See source notes for context.
Create an additional comparison script containing **atleast 10** `criterion` benchmarks which compare the performance speed and quality metrics between this crate
Reach people exploring AI agents
See placements →Evidence at a glance
Sourced account- Source author
- Max Woolf
- Original account
- Read the source ↗
- Published
- 21 Sept 2026
- Source link checked
- 15 Oct 2026
- Reported result
- Max Woolf reports using Codex to build and iteratively benchmark a Rust template engine against established crates, then add a compile-time path after losing that comparison.
- Human involvement
- Woolf defines comparison constraints and reviews results. The unreleased implementation and possible benchmark gaming limit independent verification.
A linked account supports attribution. It does not mean we independently reproduced its result.
Report an issue with this case
Open correction emailOpens your email app with the case link included. Nothing is sent automatically.
How the agent did it
- Codex builds the initial Rust template engine and runs optimization passes.
- It creates Criterion comparisons against askama, minijinja and tera over varied workloads.
- It changes library code and reruns measurements while preserving benchmark integrity constraints.
Max Woolf used agent-driven benchmark iteration to improve Rust software. One concrete example in his account is a template engine built with Codex. After initial optimization passes, he asked it to compare the implementation against askama, minijinja and tera across different input sizes and realistic workloads.
The workflow used Criterion benchmarks to establish performance, make a library change and measure again. Woolf's constraints forbade editing benchmark code to manufacture a win and sought comparable workloads rather than a special advantage for his implementation. His broader process also included review agents and refactoring with regression checks.
For the template engine, Woolf reports roughly twice the performance of minijinja and tera on most benchmarks. It still lost to askama, whose compile-time approach differed. He then instructed Codex to add a compile-time path and reports that the comparison improved. This sequence is useful because an unfavorable measurement changed the implementation strategy.
The results remain the author's observations. The project was still being prepared for release, the full implementation was not available for independent inspection in the account, and Woolf explicitly acknowledges the possibility of subtle benchmark gaming. Neither the target in a prompt nor a screenshot establishes universal performance superiority.
Prompt
Original prompt
Source: Blog · Max Woolf
Frequently asked questions
Which crates were compared?
The account names askama, minijinja and tera as template-engine comparisons.
What happened when the engine lost a comparison?
Woolf says askama won because of its compile-time approach, so he asked Codex to add a compile-time path.
Were these independently reproduced results?
No. They are Woolf's reported results, with explicit concerns about hidden benchmark gaming and code still being prepared for release.
More details
Remaining steps
- After the compile-time competitor wins, Woolf asks Codex to implement a compile-time path and reports an improved result.
About this account
Codex implements the engine, runs comparisons and iterates on library code using measured results as feedback.
Firsthand account opened and read, with linked project documentation where available. Outcomes are author reports, not independently reproduced. Benchmarks and speedups are author reports; code was not yet released and hidden benchmark gaming remains a stated concern. Original prompt box contains a short excerpt of the author's published actual-run instructions.
Credit: Max Woolf
Source published 21 Sept 2026
Source checked 15 Oct 2026
Tools and topics
Codex · Rust · Criterion
Codex · Rust · Criterion
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.