How AI Coding Agents Helped Shopify Achieve 53% Performance Boost
Tobias Lütke used AI coding agents to squeeze 53% faster performance out of Shopify's Liquid template engine. Here's what the autoresearch pattern reveals about the future of programming.
Tob
Backend Developer
Tobias Lütke, CEO of Shopify, just pushed 93 commits to improve Liquid, Shopify's open-source Ruby template engine. The result: 53% faster parse and render times, 61% fewer memory allocations. He did it using AI coding agents running hundreds of automated experiments.
TL;DR: The "autoresearch" pattern, where an AI agent continuously experiments with performance optimizations, helped Liquid achieve a 53% speed boost after 20 years of manual tuning. This shows coding agents can find optimizations humans missed, especially when given clear benchmarks to optimize against.
The Old Way vs The Agent Way
Liquid has been around since 2005. Hundreds of contributors have tweaked it over two decades. Traditional optimization works like this: a developer spots a bottleneck, runs benchmarks, implements a fix, and repeats. It's slow and relies on human intuition to find the right spots.
The autoresearch pattern flips this. You give an agent a benchmark script, tell it "make it faster," and let it run hundreds of experiments in parallel. The agent tries many approaches, measures results, and reports back what worked.
Tobi (Lütke) started with an autoresearch.md prompt file and a shell script to run the test suite and report benchmark scores. The agent generated 120 automated experiments that resulted in 93 commits.
What Actually Worked
The PR description lists concrete optimizations:
- StringScanner replacement: Replaced StringScanner tokenizer with String#byteindex. Single-byte byteindex searching is ~40% faster than regex-based skip_until. This alone reduced parse time by ~12%.
- Pure-byte tag parsing: Eliminated the costly StringScanner#string= reset that was called for every
{% %}token (878 times). Manual byte scanning for tag name and markup extraction is faster than resetting and re-scanning.
- Cached integer to_s: Pre-computed frozen strings for 0-999 to avoid 267 Integer#to_s allocations per render.
These aren't revolutionary techniques. They're micro-optimizations that humans could have found. But the agent found them systematically, testing many approaches in hours rather than weeks.
Why This Matters
This isn't just about Liquid. It's about what happens when CEOs can code again.
Lütke has always been hands-on, but coding agents make a significant contribution feasible for someone in a high-interruption role. They can work with code productively in short bursts, and the agent handles the grunt work of testing and iterating.
The pattern also requires something many projects lack: a robust test suite. Liquid has 974 unit tests. Without that, you can't safely let an agent run hundreds of experiments. The test suite is the requirement for autoresearch.
The Bigger Picture
Simon Willison noted this pattern is showing up across companies: coding agents let people in high-interruption roles productively work with code again. The "November 2025 inflection point" when coding agents got really good is now paying real dividends.
If your codebase has good tests and a benchmark script, you can now say "make it faster" and get actionable results. The agent becomes a force multiplier for performance work.
Sources: Shopify/liquid PR #2056, Simon Willison's Weblog, Hacker News