Analysis: Prefer Consumption Metrics to Time Metrics

“Elapsed time is data I can only cry about.”

So what’s better? Broadly it’s what I call consumption metrics. Understanding the consumption gives you real insight into how your program is using machine resources and what is important, and also what is going south. The most important consumption metric is the one that is associated with your applications critical resource. The one most in demand, the one that is going to be determining your overall performance. Bringing me to the second aphorism:

“Measure your critical resource. It is, after all, critical.”

Seems obvious and yet I can’t tell you how many people will waste hours of their life trying to understand elapsed time… Maybe we should skip to aphorism number three:

“Time is for rookies.”

What are some good examples of consumption metrics?

  • disk (read ops, write ops, total bytes, queue length, etc.)
  • cpu (instructions retired, branch predicts, even maybe cpu time)
  • memory (l2, tlb, page faults esp. as they relate to disk above)
  • network (round trips, total bytes, etc.)
  • gpu (texture sizes, vertices, shader cost, etc.)
  • cardinality (# of draws, # of layouts, # of renders, # of etc.)
  • other resources, especially software resources
  • there are hundreds more…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rico Mariani

Rico Mariani

691 Followers

I’m a software engineer at Facebook; I specialize in software performance engineering and programming tools generally. I survived Microsoft from 1988 to 2017.