# 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.

Agent: Codex
Tools: Codex, Rust, Criterion
Category: Software & DevOps
Date: 2026-09-21

Outcome: 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.

## Steps

1. Codex builds the initial Rust template engine and runs optimization passes.
2. It creates Criterion comparisons against askama, minijinja and tera over varied workloads.
3. It changes library code and reruns measurements while preserving benchmark integrity constraints.
4. After the compile-time competitor wins, Woolf asks Codex to implement a compile-time path and reports an improved result.

Human oversight: Woolf defines comparison constraints and reviews results. The unreleased implementation and possible benchmark gaming limit independent verification.

Source: [Max Woolf](https://minimaxir.com/2026/09/agentic-iteration/)

Canonical URL: https://agentsinuse.com/use-cases/codex-to-benchmark-and-optimize-a-rust-template-engine/
