Shopify/liquid: Performance: 53% faster parse+render, 61% fewer allocations

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Coding agents running automated experiments can now squeeze major performance gains out of mature codebases, making the 'give an agent a benchmark and tests' workflow a repeatable engineering practice.

Read this as

Shopify's CEO Tobias Lütke used an AI coding agent to speed up Liquid, the template engine that builds Shopify store pages. The agent ran about 120 automated experiments and made the software 53% faster with 61% fewer memory allocations. Liquid is open source Ruby code that has been worked on for 20 years, so big speedups were not expected. It shows AI tools helping even experienced executives contribute real code again.

Shopify CEO Tobias Lütke merged a pull request making Liquid, Shopify's open source Ruby template engine, 53% faster on parse-and-render benchmarks. He did it using Karpathy's autoresearch method with the Pi coding agent, running ~120 automated experiments yielding 93 commits. The key enabler was Liquid's 974 unit tests, which let the agent verify every change safely. Teams with strong test suites and benchmarks can replicate this pattern cheaply.

Tobi Lütke's PR (93 commits from ~120 agent-run experiments) delivered 53% faster parse+render and 61% fewer allocations in Liquid. Wins include replacing the StringScanner tokenizer with String#byteindex (~12% parse-time reduction alone), pure-byte parse_tag_token avoiding StringScanner#string= resets, and caching Integer#to_s strings for 0-999. He used the Pi agent with a pi-autoresearch plugin maintaining state in autoresearch.jsonl, seeded by an autoresearch.md prompt and a benchmark script. The 974-test suite was the prerequisite.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Liquid Shopify autoresearch nanochat Pi

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading