- What: Shopify CEO Tobias Lütke optimized the Liquid template engine using AI coding agents.
- Performance Gains: 53% faster parse and render times; 61% reduction in object allocations.
- Methodology: Utilized the "autoresearch" agentic framework inspired by Andrej Karpathy.
- Tools Used: The Pi coding agent and a new "pi-autoresearch" plugin.
Shopify CEO Tobias Lütke has delivered a massive performance overhaul to Liquid, the company’s 20-year-old open-source template engine, by employing semi-autonomous AI coding agents. In a move that highlights the shifting landscape of software engineering, Lütke utilized an "autoresearch" methodology to achieve a 53% improvement in parse and render speeds while slashing memory allocations by 61%.
The update, submitted as a pull request to the Liquid repository, represents one of the most significant performance leaps in the project's history. By leveraging AI to run over 100 experiments in just 48 hours, the initiative demonstrates how agentic workflows can revitalize legacy codebases that have already been "optimized" by hundreds of human contributors over two decades.
The Autoresearch Breakthrough
The optimization process was built on a variant of "autoresearch," a concept recently pioneered by AI researcher Andrej Karpathy. This system involves a coding agent running hundreds of semi-autonomous experiments to find marginal gains that human developers might overlook or find too tedious to test manually.
Lütke’s implementation began with a specialized prompt file (autoresearch.md) and a shell script (autoresearch.sh) designed to give the AI agent a clear objective: "make it faster." The agent was tasked with brainstorming potential improvements, executing them, running them against a benchmark suite, and reporting the results.
The final pull request includes 93 commits generated from approximately 120 automated experiments. According to the project documentation, the agent successfully identified dozens of micro-optimizations that collectively moved the needle on performance in a way manual intervention had failed to do for years.
Technical Deep Dive: Squeezing Juice from Ruby
The AI agent focused on reducing the overhead of Ruby’s String and Integer handling. Some of the most impactful changes included:
- Replacing StringScanner with
byteindex: The agent discovered that single-bytebyteindexsearching is roughly 40% faster than the regex-basedskip_untilmethod. This change alone reduced overall parse time by 12%. - Pure-byte Tag Parsing: The agent eliminated costly
StringScanner#string=resets that occurred for every{% %}token. By switching to manual byte scanning for tag names and markup extraction, the engine avoided 878 resets per test run. - Integer Caching: To reduce memory pressure, the agent pre-computed and froze strings for integers 0-999. This avoided 267
Integer#to_sallocations for every single render cycle.
"This all added up to a 53% improvement on benchmarks—truly impressive for a codebase that's been tweaked by hundreds of contributors over 20 years," noted tech analyst Simon Willison in a review of the PR.
The Role of the "Coding CEO"
The most striking aspect of the announcement is the identity of the contributor. Tobias Lütke, who originally created Liquid in 2006, serves as the CEO of a company with over 7,500 employees. While Lütke has remained more technical than most executives, the use of AI agents marks a "return to the tools" for leaders in high-interruption roles.
Data from Lütke’s GitHub contribution graph shows a dramatic spike in activity starting in late 2025, coinciding with the "inflection point" where coding agents became highly reliable. The project utilized the Pi coding agent in conjunction with a newly released pi-autoresearch plugin, developed in collaboration with David Cortés. This plugin maintains an autoresearch.jsonl file to track state across hundreds of iterative trials, allowing the CEO to oversee the strategy while the AI handles the execution.
Impact on Developers and Industry
For the broader AI and software industry, this event serves as a definitive case study for "Agentic Engineering."
- Tests as a Safety Net: The success of this experiment relied heavily on Liquid’s robust test suite of 974 unit tests. Without a high-coverage suite to prevent regressions, letting an autonomous agent commit 93 times would be impossible.
- The Death of Manual Micro-Optimization: Tasks that previously required senior engineers to spend weeks with profilers can now be offloaded to agents that "brute-force" creativity through massive experimentation.
- Efficiency Gains for Commerce: As Liquid powers millions of Shopify storefronts, a 53% faster render time translates directly to better Core Web Vitals (LCP/TTFB) for merchants and potentially higher conversion rates across the entire Shopify ecosystem.
This shift suggests that "this changes how developers will interact with legacy code; for the first time ever, the oldest parts of a system might become the most optimized."
What's Next
The "autoresearch" pattern is expected to see rapid adoption across other open-source projects and enterprise environments. By providing an agent with a benchmarking script and a goal, companies can essentially "mine" their existing code for performance gold.
As for Shopify, the collaboration between human leadership and agentic intelligence is likely to expand. The partnership between Shopify and Liquid AI (the foundation model company) suggests that sub-20ms inference and even deeper core commerce optimizations are on the horizon. For now, the "pi-autoresearch" plugin is available for developers looking to replicate Lütke's results in their own repositories.

