AI Agents Can Now Optimize Your Slow Java Code: A Spring Boot Workflow That Used to Need a Specialist Dan Luu's essay 'There's no reason for software to be slow anymore' argues that AI agents can now perform performance optimizations that previously required specialists, reducing the human-time cost by orders of magnitude. The article presents a practical workflow for using AI agents to optimize slow Spring Boot hot paths, drawing on Luu's experiments and examples like Jamie Brandon's use of Claude on Anthropic's performance exercise. Last week a tweet went viral claiming that people complaining about LLM-generated bloat would "eat crow" once everything gets rewritten in hand-optimized assembly. Dan Luu, the engineer behind some of the most cited performance writing on the internet, responded with an essay titled "There's no reason for software to be slow anymore." It hit 620 points on Hacker News in about a day, and its argument should change how every Java team spends its next sprint. The core claim is simple and backed by real experiments: performance work that used to require a rare specialist can now be done by anyone who can type a few sentences. Luu quantifies it. The human-time cost of an optimization has dropped by what he calls "frequently 1000x / 10000x / 1000000x." He had an agent do workload-specific optimization of his own ripgrep usage, and launching it took about 2 minutes of his time. Jamie Brandon, a strong performance engineer, took Anthropic's public performance takehome exercise, then let Claude pick up where he left off. Claude got a much better result. Looking at the diff, Brandon said some of the agent's optimizations were things he had thought of but not gotten to, and others were, in his words, "just crazy shit that I would never try unless I was working on this for weeks." If you have spent six years writing Spring Boot services like I have, your reaction is probably the same as mine: interesting for regex engines, but what does this mean for the average enterprise Java service? The honest answer is that most of us will never need a custom JIT. But the underlying shift, that measuring and trying an optimization now costs minutes instead of days, applies directly to the slow endpoints every real codebase accumulates. This article is a practical workflow for turning an AI agent loose on a slow Spring Boot hot path without letting it ship garbage. Full disclosure up front: the numbers I cite from Luu's essay are his experiments, not mine. The workflow below is the one I now run against my own services, adapted from how his agent loops are structured, and every piece of code in it is runnable as written. JVM teams have always optimized less, not more. The conventional wisdom in the Java world is that the JVM's JIT handles performance, so you should write boring code and let HotSpot do its thing. That advice was correct when an optimization investigation cost a specialist three days. It stops being correct when the investigation costs two minutes of typing. Think about the optimizations that "were not worth it" on your last project: Pattern instead of calling Pattern.compile per requestNone of these are clever. All of them were skipped on projects I worked on because nobody had the time to prove they mattered. Luu describes exactly this calculus: he would look at an optimization, estimate it was worth 2%, estimate it would take N person-days to verify, and make a judgment call. When N collapses by three orders of magnitude, the judgment call collapses with it. The number of optimizations worth trying goes way up, including the speculative ones you were never sure would pan out. Michael Malis, quoted in the same essay, takes it further: with AI, "we could look at a customer's workload and add optimizations as needed." Software fitted to a particular workload instead of a class of workloads. For a Spring Boot service with a known traffic pattern, that is not science fiction. It is a benchmark harness plus an agent loop. Before the workflow, you need the one lesson from Luu's essay that most viral summaries skipped. His agent-built regex engine, FRE, was initially "heavily overfit" to the benchmark suite it trained on. It only generalized after he explicitly warned the agent that a holdout benchmark existed. Even then, the final holdout speedup on representative queries was a modest 7%, not the flashy 2x-4x seen on the easy queries. This maps exactly onto a mistake I have watched humans make for years: tuning for a synthetic load generator while production traffic looks nothing like it. An agent makes the failure mode cheaper to reach and faster to ship. So the workflow below is built around one non-negotiable structure: the agent optimizes against one set of real workload samples, and it is scored against a holdout set it never sees. That is the difference between a performance improvement and an overfit benchmark gamer. Here is the full setup, structured the way Luu's loops are structured: a fixed harness, real workload data, an optimization loop, and a holdout gate. I will use a realistic example, a user-agent parsing endpoint, because it is the kind of deceptively slow code that exists in almost every service that logs traffic or does analytics. Extract samples from production, split them, and freeze the split. Luu's analysis of a month of his own ripgrep queries found that 94% of patterns occurred only once, but file locality was high. Your traffic has shape too, and you cannot guess it from your desk. Take user-agent strings from your access logs they are not secrets, and this is exactly what they are for , shuffle them, and write two files: // Splitter.java - run once, commit the output files List