The Cost of Waiting for Builds
14/03/2025
Yesterday I was listening to a podcast episode on Using Cognitive Science to Improve Developer Experience with Hans Dockter, the founder and CEO of Gradle, where he talks about some of the findings of cognitive science and how they can be applied to software development.
One of the things that stood out to me was an anecdote about how he worked with a company that had a long feedback cycle. The company and problem weren’t specified, but we can imagine it’d be something like having to wait for a significant amount of time for a build to complete. Hans’ team told the company that they might be able to cut that time in half. The developers were excited by this prospect and looked forward to the increased productivity. However, management started to ask whether it was really that important:
“Why can’t they just do something else while they’re waiting?”
The answer is that they try to, but they aren’t as productive, the quality of their work suffers, and they get crankier. There is a cost to context switching.
Studies on Context Switching
Hans mentioned some studies on context switching. The anecdotal experiment is as follows: you give two groups of people the same tasks but one groups are encouraged to multitask while the other group are prohibited from multitasking. The multitasking group will generally take longer to complete the tasks, and the quality of their work will be worse.
What’s more pernicious, however, is the way that the multitasking group will feel about their work. The multitasking group will score higher on perceived productivity than the group that was allowed to focus on one task at a time. That is, when asked about how productive they felt they were on a scale of one to ten, they’ll rate themselves higher than the group that was allowed to focus.
While I couldn’t find the specific study that Hans seemed to be referring to, there’s lots of research on the topic. Searching for the following key terms will bring up a lot of interesting avenues for further reading:
- Task Switching
- Cognitive Shifting
- Context Switching
- Media Multitasking
- Cognitive Fatigue
I also came across these interesting papers on the topic that explore the dynamics and psychology of multitasking:
- Rubinstein, Meyer, Evans (2001) Executive Control of Cognitive Processes in Task Switching
- Sanbonmatsu, Strayer, Medeiros-Ward, Watson (2013) Who Multi-Tasks and Why? Multi-Tasking Ability, Perceived Multi-Tasking Ability, Impulsivity, and Sensation Seeking
- Ophir, Nass, Wagner (2009) Cognitive Control in Media Multitaskers
From some cursory reading over this topic, there’s a lot of nuance, but it seems clear to me that there is a cost to cognitive switching and that multitasking is generally not desirable.
Investing in Your Build Pipeline
Of course, multitasking is inevitable in many situations. But if you get the chance to easily:
- reduce compilation times
- reduce deployment times
- reduce the time it takes to run your tests
- make monitoring easier
Then you should seriously consider it. Don’t take it from me: for some hard numbers, take a look at Hans’ own article on Quantifying the Costs of Builds.