Skip to Content
How to Make Things Faster
book

How to Make Things Faster

by Cary Millsap
June 2023
Intermediate to advanced
356 pages
5h 32m
English
O'Reilly Media, Inc.
Content preview from How to Make Things Faster

Chapter 85. The Ratio Trick

I’ve played the same evil genie trick in both the Oracle buffer cache hit ratio story, and the mpg story. And I can play it for any ratio you want, even throughput and response time! Here’s the trick.1 Any ratio (r) is the quotient of a numerator (n) and a denominator (d): r = n/d. You probably remember two ways to make a ratio’s value bigger:

  1. You can make the numerator (n) bigger; or

  2. You can make the denominator (d) smaller.

Option b is always a good move for higher-is-better metrics, because the denominator represents a cost that you want to reduce. In the Oracle story, the denominator was the number of attempts upon the buffer cache. Eliminating attempts reduces the amount of work that the machine has to do, which frees up resources and makes the system run better. In the mpg story, the denominator was the amount of fuel consumed. Of course, the less fuel you consume, the better.

Option a—making the numerator bigger—is a sneaky option. In a higher-is-better metric, the numerator represents the good thing that you want more of.…Except when you have all you want of your good thing, and you don’t need any more. In the Oracle story, we wanted more cache hits for a given attempt count. If making the cache bigger accomplishes that, then it’s a win for the system. But you don’t need a bunch of extra hits caused by the choose_a_hit_ratio program, putting an extra burden on the system just to pad the hit rate.

Likewise, in the mpg story, you didn’t ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Improve Your Problem-Solving Skills

Improve Your Problem-Solving Skills

Charles Humble

Publisher Resources

ISBN: 9781098147051Errata Page