Netflix's Rajat Shah has an agent read production profiles and lets a canary judge the fix
Rajat Shah describes a Netflix experiment in which a coding agent read production CPU profiles, spotted inefficient patterns from the call stack and drafted fixes. Findings go into a shared Git catalog, and fixes must pass tests and a canary before an engineer reviews them.
Watch from 2:17Recording by AI Engineer.
The idea
The speaker’s argument, in our words.Performance work, as Shah describes it, is manual: capture a profile, open it in a visualizer, hunt for hot paths, find the code, fix it. His team tested whether an agent could do the search on a couple of live services. The bet is that profiles from Java, Python or Go share a structure (call stacks with self and inclusive CPU), and that models already recognise common anti-patterns such as quadratic loops, loop invariants and repeated allocation. Once it has a suspect, the agent checks out the commit running in production, not the latest one, and drafts a code review.
Shah proposes a central catalog of findings as plain Markdown in Git, written by agents and by engineers who build frameworks. Each entry lists symbols to search for, the services where it was confirmed and a confidence level that rises with confirmations. Confidence only decides whether to open a code review, never whether to ship: in Shah's words, the profiler gives the estimate and the canary gives ground truth, and an engineer decides.
What they found
From the talk. Figures are self-reported unless stated.From the profile's call stack alone, before reading source, the agent recognised that ImmutableMap.copyOf used inside a tensor-merge method made the work quadratic rather than linear.
Netflix experiment on a couple of live services, self-reported. Shah conditions this on the model having been trained on good-quality code (6:24).
Case study
7:56The quadratic pattern took 8.8% of CPU time during the profiling period.
Self-reported. 8.8% is the CPU attributed to the pattern, not the saving; realised CPU and latency savings were on a slide but not spoken, so we do not report them. Shah also says that, with instructions in a skill or prompt, checking out the production commit, locating the code and sending a code review could take under five minutes in a very large codebase (checkout at 9:38, five minutes at 11:22).
Measured result
10:23After spotting Spectator counters created on every iteration of a hot path, the agent searched other repositories and found the same pattern in seven services; fixing all of them could save between 0.5% and 4.6% of CPU cycles.
The seven services are reported as found. The savings range is an estimate if all were fixed, not a measured result; how it was estimated is not stated.
Case study
13:31Before asking for human review, the agent should run tests and an automated canary: old and new code on two machines with the same traffic, comparing CPU, latency and error rate.
The traffic runs for a period such as ten minutes, and an increase in error rate is a signal not to proceed. He stresses these are standard infrastructure, not AI problems, and that an engineer makes the final decision (23:23).
Technical recommendation
22:38
Why it matters
Our reading. Not said in the talk.Most agent work on code is judged on correctness. Shah adds a cost check built on data teams already collect, and makes each finding reusable across services. incident.io makes the same choice for AI traces: the visual tool is for people, and the agent works from a structured export of the same data.
What one could try
- Give an agent a downloaded profile plus the commit hash of the running build and ask for suspected anti-patterns with their call paths.
- When an agent confirms a pattern in one service, have it search other repositories for the same symbols and record the pattern, with a bad and a good example, in a shared Markdown catalog.
- Before an agent-proposed performance change reaches review, require passing tests and an automated canary report on CPU, latency and error rate.
Limitations
- Results come from a couple of services at one company and are self-reported; realised savings were not stated in the talk.
- The 0.5% to 4.6% range is an estimate of savings if all seven services were fixed.
- Using the catalog in code review and while code is written is proposed, not shown; Shah notes it costs tokens and needs a hierarchical index so it does not fill the context.
- Shah ties pattern recognition to the quality of code the model was trained on and notes test coverage is rarely complete, which is why the canary and human approval stay.
Original sources
AI Engineer World's Fair 2026 · Jul 28, 2026
AI Agents for Performance: Ship Faster, Pay Less
Rajat Shah · Netflix · 34 min
This is our synthesis of the talk, checked against the transcript at the linked moments.


