How to measure speed honestly, where time goes, and what tokens cost.
Ask an agent to make something faster and it will gladly try. It rewrites a loop, adds a cache and tells you the page should feel snappier now. The word to notice is should. A claim about speed is either a measurement or a guess, and on the page they read the same. Nothing in the agent's sentence tells you which one you got, so you have to ask for the number.
There is some evidence this happens more than it should. A preprint from December 2025 read performance pull requests on GitHub: 128 of 280 written by agents (45.7%) showed any validation, against 49 of 77 by people (63.6%), and the agents leaned on reasoning about the code where people more often ran a benchmark. The authors call the link significant but weak, used a model to help with labelling, and can't see checks that happened outside the pull request. They also didn't test whether the changes worked. It is one small study, so treat it as a reason to ask for the number and not as a verdict.
So the first half of this chapter is about measuring honestly: how to time something, why an average hides the people having the worst time, where the time really goes, and why a server gets slow long before it is full. The second half is about the bill. Chapter 5 gave you the price of a token. Here it becomes the cost of a finished task, and the question of how to spend tokens on purpose.
Many benches here time real code on your device, so your numbers will differ from anyone else's, and they will change when you run them again. Learning to read that variation is part of the chapter. The ones that simulate something say so.