tag:blogger.com,1999:blog-29543598122490720532024-03-14T03:09:41.988-05:00Cary MillsapMy web log for things I’m interested in, including design, software development, performance analysis, learning, and running a business.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.comBlogger120125tag:blogger.com,1999:blog-2954359812249072053.post-33455317408453281142023-08-21T12:09:00.000-05:002023-08-21T12:09:45.792-05:00How Slow Programs Are Like Christmas: a Sales Pitch<p>My company, <a href="https://method-r.com" target="_blank">Method R Corporation</a>, makes systems faster. And we make people who make systems faster, faster. We train people to become performance optimization heroes.</p><p>Here is my story about why you should be interested in our training.</p><p>%%</p>
<p>Slow programs remind me of Christmas when I was a kid. In early December, my parents would put a present for me under our Christmas tree. It would be wrapped up so I couldn't see what was inside it. The unwrapping would not happen until Christmas morning, December 25. (That was the best-case scenario. If my Dad couldn't be home because of work, then Christmas morning would come a day or two late.)</p><p>So, every day, for nearly a month, I would see that present under the tree and wonder what was in it. </p><p>I'd take any clue I could find. What shape is it? What does it weigh? What does it sound like when I shake it? (Sometimes, my Mom and Dad would prohibit me from shaking it.) No matter how desperate the curiosity, all I could do was guess.</p>
<p>When Christmas came, I'd finally get to tear the paper off, and I would now see, plain as day, what had been in that box the whole time. All the clues and possibilities would collapse into a single reality. Finally, there was no more mystery, no more guessing.</p>
<p>Slow programs are like that. The clues aren't enough. You guess a lot. But with slow programs, there's no specially designated morning when your programs reveal their mysteries to you. They just keep irritating you, with no end in sight. You need <i>somebody</i> who knows how to tear the wrapping paper off those programs so you can see what they're doing wrong. </p>
<p>That's the <i>somebody</i> I like being. The role scares a lot of people, but it doesn't scare me. That's because I trust my preparation. I know that I have <i>three particular assets</i> that tilt the game in my favor. </p><p>Those assets are <i>knowledge</i>, <i>tools</i>, and <i>community</i>. With the knowledge and tools I have, I don't get stumped very often. But when I do, I have a network of friends who'll help me out. My friends and I can solve just about anything. These three assets are huge for both my effectiveness and my confidence.</p>
<p>These three assets aren't just for me. They're for <i>you</i>, too. </p><p>That's the aim of my online course called "<a href="https://method-r.com/training/motd">Mastering Oracle Trace Data</a>." In this course, I've bundled everything you need to claim those three assets for your own:</p><ol style="text-align: left;"><li>You'll learn the details about Oracle traces and the stories they're trying to tell you. This is your <i>knowledge</i> asset.</li>
<li>You'll have, for the duration of your choosing, full-feature access to <a href="https://method-r.com/software/workbench">Method R Workbench</a>, the most comprehensive software in the world for mining, managing, and manipulating Oracle traces. This is your <i>tools</i> asset.</li>
<li>You'll have access to our Slack channel, a global community of Oracle trace enthusiasts that can help you whenever you get stumped. You won't be alone. You'll have people who are there for you. This is your <i>community</i> asset. </li></ol>You can also fortify all three of your new assets by purchasing <i>office hours</i> for the course. Office hours are Zoom sessions, where you can spend time with my friends and me, discussing your questions about the material.<br />
<p>If you're interested in becoming a more effective and confident optimizer, you can get started <i>now</i>. Just visit our <a href="https://method-r.com/training/motd" target="_blank">course page</a> for details.</p><p>%%</p><p>That's my story. I hope you'll contact me at <a href="http://method-r.com">method-r.com</a> if you're interested.</p><p>And if you like stories like this, you'll find a lot more in my <i><a href="https://method-r.com/books/faster" target="_blank">How To Make Things Faster</a></i> book, available wherever books are sold.</p><p></p><p></p>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com0tag:blogger.com,1999:blog-2954359812249072053.post-58750838193590115722023-08-21T12:00:00.001-05:002023-08-21T12:06:32.026-05:00A Design Decision<p>This week, my team at <a href="https://method-r.com" target="_blank">Method R</a> devoted some time to an enhancement request that required an interesting design decision. This post is about the analysis behind that decision.</p><p>The enhancement request was for our flagship product called <a href="https://method-r.com/software/workbench" target="_blank">Method R Workbench</a>. It's an application that people use to mine, manage, and manipulate Oracle trace files.</p>
<p>One of its features, called <code><a href="https://method-r.com/man/mrskew.pdf" target="_blank">mrskew</a></code>, is a tool that allows a Workbench user to filter, group, and sort the raw dbcall and syscall data that Oracle Database processes write to their trace files. You can use <code>mrskew</code> from within the Workbench application, or from a *nix command line.</p>
<p>Here's an example of a <code>mrskew</code> command. It's what you would use to find out how long your program spent reading Oracle blocks from secondary storage. It will show you which blocks it read, how long they took, and how many times each block was read:</p>
<blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><pre style="text-align: left;">mrskew --name='db.*read' \
--group='sprintf("%8d %8d", $p1, $p2)' \
x_ora_1492.trc</pre></blockquote>
<p>Here's the output:</p>
<pre>sprintf("%8d %8d", $p1, $p2) DURATION % CALLS MEAN ...
---------------------------- -------- ------ ----- --------
2 2 0.072918 1.0% 26 0.002805 ...
33 698186 0.051940 0.7% 1 0.051940 ...
50 339841 0.049261 0.7% 1 0.049261 ...
...</pre>
<p>The important thing in this report is the <i>meaning</i> of the <code>$p1</code> and <code>$p2</code> variables. The combination of these two variables happens to represent the data block address (the file number and block number) of an Oracle block that was read by some kind of an Oracle <i>read</i> call. It would be nice for the report to tell you that instead of just telling you that the first two columns of numbers are the output of an <code>sprintf</code> function call.</p>
<p>We have a command-line option for that. The <code>‑‑group-label</code> option lets you assign your own title for the group column. So, with some careful character counting, you could use…</p>
<blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><pre style="text-align: left;">‑‑group-label=' FILE BLOCK'</pre></blockquote>
<p>…to get exactly the heading you want:</p>
<pre> FILE BLOCK DURATION % CALLS MEAN ...
----------------- -------- ------ ----- --------
2 2 0.072918 1.0% 26 0.002805 ...
33 698186 0.051940 0.7% 1 0.051940 ...
50 339841 0.049261 0.7% 1 0.049261 ...
...</pre>
<p>That makes sense. Now it's easy to see that Oracle has read one block (file #2, block #2) 26 times, consuming a total of 0.072918 seconds reading it.</p><p>The group label fits the output, only because of the careful character counting. The enhancement request was to allow the <code>‑‑group-label</code> option to take an <i>expression</i>, not just a string. Like this:</p>
<blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><pre style="text-align: left;">--group-label='sprintf("%8s %8s", "FILE", "BLOCK")'</pre></blockquote>
<p>That way, he could print out the header he wanted, perfectly aligned, by just syncing his <code>‑‑group‑label</code> expression to his <code>‑‑group</code> expression, without having to count space characters that are literally invisible.</p>
<p>It's a smart idea. The group label option should have been designed that way from the beginning. We eagerly approved the enhancement request and began thinking about the design.</p>
<p>When we thought it through, we ended up with two different ideas about how we could implement this new idea:</p>
<ol style="text-align: left;">
<li>Redefine <code>‑‑group‑label</code> to take an <i>expression</i> instead of a string. <code>mrskew</code> will calculate the value of the expression before printing the column label.</li>
<li>Create a new option, say, <code>‑‑new‑group‑label</code>, that takes an expression as its argument. And leave <code>‑‑group‑label</code> as it is.</li>
</ol>
<p>The first idea is how the enhancement request was worded. The second idea entered our minds because the first idea creates a compatibility problem: if we change the spec of the existing <code>‑‑group‑label</code> option, it will break some existing <code>mrskew</code> scripts. For example, these will work in Workbench 9.2.5:</p>
<blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><pre>--group-label=FILE
--group-label="FILE BLOCK"
</pre></blockquote>
<p>But if we redefine <code>‑‑group‑label</code> to take an expression instead of a string, then these won't work anymore. People will need to quote their string expressions like this:</p>
<blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><pre>--group-label='"FILE"'
--group-label='"FILE BLOCK"'</pre></blockquote>
<p>In the end, we decided to redefine the existing option and live with the compatibility breach.</p><p>The way we make decisions like this is that we create strenuous arguments for each idea. Here are some of the arguments we considered en route to our decision.</p>
<p>First, the <b>customer experience (cognitive expenditure).</b></p>
<p>Everyone who participated in the debate had the customer experience foremost in mind. But how can we objectively measure "customer experience"? How do you structure a scientific debate about the superiority of one experience over another?</p>
<p>One way to do it is to measure <i>cognitive expenditure</i>—the amount of mental effort that a user has to invest to get the desired outcome from our software. We want to minimize cognitive expenditure, to maximize a customer's return on investment of effort.</p>
<p>We began by realizing that responding to this enhancement request with one of our two ideas would necessarily force the user into one of two new regimes:</p>
<ol style="text-align: left;">
<li>The syntax of <code>‑‑group-label</code> has changed.</li>
<li>There's a new <code>‑‑new-group-label</code> option.</li>
</ol>
<p>In regime 1, our users would have to learn the new syntax. That's a cognitive expenditure. But it's a one-time expenditure, which is good. The new syntax would be consistent with the existing <code>‑‑group</code> syntax, which is actually a cognitive savings for our users over what we have now. However, if a customer had saved any scripts that used the old syntax, then the customer would have to convert those scripts. That's a cognitive expenditure in a loop (one for each script), which is bad.</p>
<p>In regime 2, our users would have to learn about <code>‑‑new-group‑label</code>, which is a cognitive expenditure. They'd still have to remember (or relearn) about <code>‑‑group‑label</code>, too, which is a similar cognitive expenditure as the one in regime 1. They wouldn't have to modify any old scripts, but they would have to make the <i>choice</i> of whether to use <code>‑‑group‑label</code> or <code>‑‑new-group‑label</code>, every time they wrote a script in the future. That's another cognitive expenditure in a loop (one for each script), which is bad.</p>
<p>Second, the <b>developer experience (technical debt).</b></p>
<p>We also need to consider the developer's experience. We don't want to create code that increases technical debt that makes the product unnecessarily difficult to support.</p>
<p>If we redefine <code>‑‑group-label</code>, there's no long-term effect to worry about. But if we add <code>‑‑new‑group‑label</code> to the story, I would expect for people to wonder, why are there two such similar group label options, when one (the one that takes an expression) is clearly superior? And why does the inferior one have the better name?</p>
<p>At some point in the future, I envision wanting to clean up the cruft and have just the one group label feature. Naturally, the right name for it would be <code>‑‑group‑label</code>. But of course, changing the spec that way would introduce a compatibility problem. To make things worse, this would occur in the future when—one would hope, if our business is growing—such a decision would impact even more customers than it would today. So then, why create the cruft in the first place? It'll be a worse problem later than it is now.</p>
<p>The question that really seals the deal, is <b>who will the change really affect?</b> It's really a probability question about customer experiences.</p>
<p>Most users who use the Workbench application will never experience our group label option directly. It's there for everybody to use, but our Workbench has so many predefined reports built into it, most users never need to touch the group label option for themselves. When they do need to modify it, they're usually tweaking a report that we've predefined for them, which is a low–cognitive-expenditure experience.</p>
<p>In the end, the Method R bears almost the entire cost of the <code>‑‑group‑label</code> redefinition. It required us to revise:</p>
<ul style="text-align: left;">
<li>The code for <code>mrskew ‑‑group‑label</code></li>
<li>The prepackaged actions in <a href="https://method-r.com/software/workbench" target="_blank">Method R Workbench</a></li>
<li>The <code>mrskew</code> .rc files</li>
<li>The <a href="https://method-r.com/man/mrskew.pdf" target="_blank"><code>mrskew</code> manual page</a></li>
<li>The <a href="https://method-r.com/books/motd" target="_blank"><i>Mastering Oracle Trace Data</i> book</a></li>
<li>The <a href="https://method-r.com/training/motd" target="_blank"><i>Mastering Oracle Trace Data</i> course</a></li>
</ul>
<p>Most users will experience the benefit of the <code>‑‑group‑label</code> change, without ever knowing that, once upon a time, it changed. And that's the way we want it. We want the product to be as smart as possible so that our customers get the most out of their investment, both cognitive and financial.</p>
Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com1tag:blogger.com,1999:blog-2954359812249072053.post-89018431848821575882023-08-10T14:17:00.021-05:002023-08-18T17:28:06.724-05:00Catchphrase<p>It finally happened.</p><p>Several years ago, I asked my friend <a href="https://mauro-pagano.com/" target="_blank">Mauro Pagano</a> to help me spread a new catchphrase. I had made up this little saying. It was weird enough that I knew, if I heard it in the wild somewhere, then it had to have come from me. It would be a fun little experiment.</p><p>The only problem with this new catchphrase was the "catch" part. It was a perfectly good "phrase," but we were having a hard time coming up with situations where we could use it. We agreed we'd keep on the lookout. </p><p>Skip forward several years.</p><p>Today, my colleague Jeff Holt and I had lunch at <a href="https://www.youtube.com/watch?v=cRpzgk_nssg" target="_blank">Weinberger's Deli</a>, as we do at least every week or two. We got there just a few minutes after they opened, but people were already queued out the door. That's ok, the line would work its way down shortly.</p><p>As we advanced nearer the counter, I found myself increasingly distracted by The Table Situation. No matter how full Weinberger's is, we're almost always able to find a table. But today, since everyone ahead of us had just sat down, it was easy to imagine that no tables would be opening up anytime soon.</p><p>This wasn't just idle worry. It was required prep for the dreaded question, "For here? Or to go?" It was already 96ºF outside, on its way to 106ºF, so we'd prefer not to sit out there. But also we would even more prefer not to take our lunch in bags back to the office. We took a risk, mitigated by the two open tables outside. We answered, "For here."</p><p>While I was paying for my order, a guy finished his lunch, leaving an open two-top. Victory. We would eat inside, comfortably, at a table. </p><p>I shouldn't be surprised. I almost always get a table. The whole thing—worry, worry, worry, get a table—it happens nearly every time. But somehow, I'm almost always surprised.</p><p>But today, in a burst of excitement, a little program that's been running in the background of my mind for years popped its confetti cannon: <i>THIS is the perfect situation for my catchphrase!</i></p><p>So I used it. Here it is:</p><blockquote><p>It's like mouse balls. You think it can't possibly work, but it almost always does. </p></blockquote>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com0tag:blogger.com,1999:blog-2954359812249072053.post-215010440927732332023-08-09T10:10:00.002-05:002023-08-18T17:26:35.487-05:00A Side Trip to Wonderhell<p>I should be jubilant. But I'm not. </p><p>I'm habitually non-jubilant. I don't know why.</p><p>This weekend, I returned from the kind of a trip that I don't take very often: an all-by-msyself vacation. This year, I attended the <a href="https://www.nats2023.com" target="_blank">IPMS/USA National Convention 2023</a> in sunny San Marcos, Texas. IPMS is the International Plastic Modelers' Society. The convention is three things: a contest, a meetup, and a vendor showcase. This is the first time I've ever attended. </p><p>The contest is a big deal. Some people spend years preparing for it. And I won two gold medals for <a href="https://method-r.com/cary/Wasp.pdf" target="_blank">a model (a "replica") that took me seven years to make</a>. It was awarded 1st place in its category and then it was named the best of its class: one of only eight such awards among a field of over 3,000 entries.</p><p>I should be jubilant. But I'm not.</p><p>There are modelers out there who have worked hard over the past who-knows-how-long, suffering now that their work didn't result in the level of appreciation they had hoped for. They probably have a right to be offended that I'm not jubilant.</p><p>One of the reasons I'm not jubilant is because I promised myself before the show that I wouldn't get too emotionally wrapped up in how my entry was judged. There are just too many things that could conspire that could deny—rightfully or not—my little model from winning a prize. So, before the show, I preloaded my mind with the following sentence: </p><blockquote><p>When you put your ego in other people's hands, you're asking for trouble. </p></blockquote><p>My wife and I have similar conversations with our kids. As she says, sometimes we need to ride the monorail, not the roller coaster. For example, when you believe you're awesome because a local sportswriter says that you are, then it's also tempting to believe that you're trash when that same writer doesn't include you in his all-area team. If you get too high or too low because of how someone <i>else</i> defines you, you're almost guaranteed to crash eventually. </p><p>That sentence of mine sustained me for the first three days of the show. The 3,000+ models on display in the contest room were <i>absolutely overwhelming</i>. There's no way I could walk in that room and feel like a legitimate competitor, no matter how hard I knew I had worked on my model. It would have been ludicrous to think I was going to win something. Even when I did, it felt like it couldn't be real.</p><p>Now that I'm home, I'm in this weird predicament of having summited an audacious, multi-year goal, certainly a <i>good</i> feeling, but simultaneously there's this looming feeling of "now what?" Sure, I won this huge award three days ago, but what have I done <i>lately</i>?! </p><p>It makes me feel like there's something wrong with me. But I know I'm not the only one. What I'm feeling happens so often, it even has a name: <a href="https://www.ted.com/talks/laura_gassner_otting_why_doesn_t_success_bring_happiness" target="_blank">Laura Gassner Otting calls it Wonderhell</a>.</p><p>At the end of all this, the feeling I'm trying to savor and cultivate is <i>gratitude</i>. Thankful for the awards, of course, but also thankful for what I really was hoping for when I signed up for the show. What really drove me while I was building my model was the hope that people might look at my model, enjoy it, and want to talk about how I built it. </p><p>That conversation happens every month in my club (my model couldn't have been what it was without my club). And it happened enough times in San Marcos to make it fully worth submitting myself to the harrowing competition part of the convention.</p><p>Maybe I'll do it again someday, I'm not sure. But for now, my monthly club meetings will be enough. Right now, I need to focus on improving <a href="https://method-r.com" target="_blank">my business</a> so much that someday soon I can blog about being oddly not jubilant about that.</p>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com0tag:blogger.com,1999:blog-2954359812249072053.post-45844676559952795482023-08-01T14:18:00.002-05:002023-08-18T17:25:46.504-05:00A Better Way to Think about %<p>A lot of people get confused by the "%" symbol. I can understand why. Even https://en.wikipedia.org/wiki/Percentage seems way more confusing than it should be.</p><p>Well, maybe I can help. </p><p>Here's a simplifying little idea that I learned by reading <a href="https://www.iso.org/home.isoDocumentsDownload.do?t=0bc30Dw3Fis0Kmeb_a6O_bzO2QP14DxJAxwtmaRLmv-WwspRuGQ-iHB6VgCGRJnU" target="_blank">ISO 80000-1</a>: </p><blockquote><p>The percent symbol (%) is just a constant, just like <i>π</i> or <i>e</i>. Its value is 0.01 (or 1/100, if you prefer).</p></blockquote><p>Let me show it to you in a table. Maybe that'll clear it up:</p>
<blockquote>
<table class="text">
<thead>
<tr>
<th>Symbol</th><th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>π</i></td><td>≈ 3.14159</td>
</tr>
<tr>
<td><i>e</i></td><td>≈ 2.71828</td>
</tr>
<tr>
<td>%</td><td>= 0.01</td>
</tr>
</tbody>
</table>
</blockquote>
<p>What this means is that anywhere you see the "%" symbol, you're free to substitute the value 0.01 if you want:</p><blockquote><div>50% = 50(0.01) = 0.5</div></blockquote><div></div><p>So, how does that help? Well, it gives you a simple rule you can apply instead of having to intuit how to convert something to or from a percentage. </p><p>For example, I used to find myself wondering, "If I want to convert this percentage to a real number, do I multiply by 100? Or divide?" I hate memorizing crap like that.</p><p>But knowing that % = 0.01 makes it easy. For example, converting 42% to a number without the % sign, I simply substitute, like this:</p><blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;">42% = 42(0.01) = 0.42</p></blockquote><p>When you know that % = 0.01, it's easy to see that 100% is just another way of expressing the number 1:</p><blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;">100% = 100(0.01) = 1</p></blockquote><p>Converting a number <i>to</i> a percentage is easy, too. </p><p>I can of course multiply anything I want by 100% and still have the same quantity I started with. Here's how to convert 0.0005 to a percentage:</p><blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p style="text-align: left;">0.0005 = 0.0005 × 1</p><p style="text-align: left;">= 0.0005 × 100%</p><p style="text-align: left;">= (0.0005 × 100)%</p><p style="text-align: left;">= 0.05% </p></blockquote><p>Yep, ISO 80000-1... I don't do everything it says, but this percentage thing was a nice revelation.</p><p></p>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com1tag:blogger.com,1999:blog-2954359812249072053.post-15421259737763379752023-07-25T16:30:00.006-05:002023-07-25T17:35:58.005-05:00Version 1 Is Never the Answer<p>I create for a living. I make <a href="https://method-r.com" target="_blank">presentations and software and books</a>... Even my hobbies are creation hobbies. I make tools and furnishings and, these days, <a href="https://method-r.com/cary/Wasp.pdf" target="_blank">“museum quality aviation replicas.”</a></p><p>Many of the things I’ve made have worked out really well, but one result I can count on: my version 1 of pretty much <i>anything</i> is rarely going to be a keeper. My good work is almost always a v2, or v3, or beyond. When I succeed, it’s usually more a persistence thing than a genius thing. </p><p>For the past couple of weeks, I’ve been working on a 20-minute session I’ll present at <a href="https://www.p99conf.io/" target="_blank">P99Conf</a>. Creating a presentation, for me, is a mostly private experience. I simulate in my mind what an audience might like to see. When either I think I’m finished, or I feel stuck, the next step in my process is to find an audience and go through the material. In other words, I <i>use</i> the material in front of other people.</p><p>Today, because I felt stuck, I showed my P99Conf material to the audience on my <a href="https://method-r.com/tuesday-zoom" target="_blank">Tuesday Zoom</a> call.</p><p>Here’s what I learned. The slides I had made were awful. Not nearly relevant enough to match my audience. I was already off the rails by the fourth slide. In the discussion though, the discussion helped to put me on the right track. The group was very helpful, identifying a couple of slides that were actually pretty good, and suggesting fixes for the worst parts. I went into the call, stuck. I came out inspired, ready to get back to work.</p><p>The thing that I suspect might surprise you, that did <i>not</i> surprise me, is how this process <i>felt</i>. I did not feel insulted or denigrated or “vulnerable.” The feelings I did have, because of the call, were these:</p><p></p><ol style="text-align: left;"><li>Gratitude – I was appreciative that the group would lend me their time</li><li>Motivation – I was inspired now, and interested; instead of stuck</li><li>Shame – I was a tiny bit embarrassed that my v1 hadn’t been better</li><li>Confidence – I knew my work was going to be better because of the review</li></ol><p></p><p>I did not feel surprised, because I don’t expect any v1 to be a production release. Most of my v1’s I expect to throw away. A v1 is simply part of the process; you can’t have v2 without v1. More precisely, and this is the critical realization in the whole process: </p><blockquote style="border: medium; margin: 0px 0px 0px 40px; padding: 0px;"><p style="text-align: left;"><b>You can</b>’<b>t have v2 without <i>feedback</i>, and you can</b>’<b>t have feedback without <i>v1</i>.</b></p></blockquote><p>My job, then, is not to try to create a v1 that is production worthy. It is to create a v1 that is <i>feedback</i>-worthy. <i>And then go get the feedback.</i> That feedback loop is essential. It’s not a step that I aspire to ever “optimize away.” It is a vital part of the process that I embrace.</p><p>If you’re interested in this story, then you might be interested in a paper I wrote in 2011, called <a href="https://method-r.com/2011/06/27/my-case-for-agile-by-cary-millsap/" target="_blank">“My Case for Agile.”</a> </p>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com0tag:blogger.com,1999:blog-2954359812249072053.post-86882418625622551292022-01-18T17:57:00.003-06:002022-01-20T09:22:41.982-06:00Why the Oak Table Was So Great<p>This weekend, I watched a wonderful <a href="https://www.youtube.com/watch?v=H2rG4Dg6xyI">TEDx video by Barbara Sher, called “Isolation Is the Dream-Killer, Not Your Attitude.”</a> Please watch this video. It’s 21 minutes, 18 seconds long.</p><p>It reminded me about what was so great about the Oak Table. That’s right: <i>was</i>. It’s not anymore.</p><p>Here’s what it was. People I admired, trusted, and liked would gather at a home in Denmark owned by a man named Mogens Nørgaard. Mogens is the kindest and most generous host I have ever encountered. He would give his whole home—every inch—to keep as many of us as he could, for a week, once or twice a year. Twenty, maybe thirty of us. We ate, drank, and slept, all for free, as much and for as long as we wanted. </p>And the “us” in that sentence was no normal, regular, everyday “us.” It was Tom Kyte, Lex de Haan, Anjo Kolk, Jonathan Lewis, Graham Wood, Tanel Põder, Toon Koppelaars, Chris Antognini, Steve Adams, Stephan Haisley, James Morle, John Beresniewicz, Jože Senegačnik, Bryn Llewellyn, Tuomas Pystynen, Andy Zitelli, Johannes Djernæs, Michael Möller, Peter Gram, Dan Norris, Carel Jan-Engel, Pete Sharman, Tim Gorman, Kellyn Pot'Vin, Alex Gorbachev, Frits Hoogland, Karen Morton, Robyn Sands, Greg Rahn, and—my goodness—I’m leaving out even more people than I’m listing.<br /><p>We spent a huge amount of our time sitting together at Mogens’s big oak table, which was big enough for about eight people. Or, in actuality, about twice that. We’d just work. And talk. If there wasn’t a meal on the table, then it would be filled with laptops and power cords covering every square inch. Oops, I mean <i>millimeter</i>. That table had millimeters.</p><p>And here’s what was so great about the Oak Table: you could say what you wanted—<i>whatever</i> it was!—and you could <i>have</i> it. You could just say your dream and your obstacle, and someone around the table would know how to make your dream come true.</p><p>It’s tricky even trying to remember good examples of people’s dreams, because I’m so far removed from it now. Some of them were nerdy things like, “I wonder how long an Oracle PARSE call would take if we did a 256-table join?” You’d hear, “Hmm, interesting. I think I have a test for that,” and then the next thing you know, Jonathan Lewis would be working on your problem. Or, “Hey, does anyone know how to do such-and-such in <i>vim</i>?” And Johannes Djernæs or Michael Möller would show you how easy it was.</p><p>I got into a career-saving conversation late one night with Robyn Sands. She had asked, “Is anybody else having trouble finding good PL/SQL developers? I can’t figure out where they are, if there even <i>are</i> any. Are there?” We talked for a while about why they were so scarce, and then I connected the dots that, hey, I have two superb PL/SQL developers at home on the bench, and I had been desperately trying to find them good work. The story that Robyn and I started some 3:00am over beers resulted in a superb consumer femtocell device for Robyn and a year’s worth of much-needed revenue for my tiny little team.</p><p>It was a world where you could have anything you want. Better yet, it was a world where you could <i>dream </i>properly<i>.</i> Today, in isolation, it’s hard to even dream right. After nearly two years of being locked away, I can barely conceive of a world that’s plentiful and joyous like those Oak Table years. I feel much smaller now. (Oh, and it wasn’t COVID-19 that killed that Oak Table experience. It died years before that—but, obviously, it’s a factor today.)</p><p>I want it back. I want my friends back. How are we going to do this?</p>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com2tag:blogger.com,1999:blog-2954359812249072053.post-47329786798087546772021-12-23T13:28:00.004-06:002022-01-13T15:09:45.488-06:00The New Book Is Ready: “Faster: How to Optimize a System”<div class="separator"><p style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://method-r.com/faster" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="" data-original-height="1728" data-original-width="2396" height="231" src="https://lh3.googleusercontent.com/-2KMOK3hLO3w/YcKgWAMJNPI/AAAAAAAACkI/1hzWI4-O4aw9mKVhrZrAtjhg7TJRE4M3ACNcBGAsYHQ/2021-12-10_16-32-59%2Bcopy.png" width="320" /></a></div></div><p>My new book called <i>Faster: How to Optimize a System</i> is ready! <a href="https://method-r.com/faster/" target="_blank">You can buy the PDF now at method-r.com</a>. <strike>The hardcover format should be available at Amazon sometime around mid-January. </strike><a href="https://amzn.to/3HZwGDb" target="_blank">The hardcover format is available now at Amazon.</a> </p><p>The physical book will be about 250 pages long, in a normal 6 × 9-inch business book format. There are 109 chapters, each of which conveys either a story or a lesson. Most of the lessons are only a couple pages long. A few of the stories are longer than that, but the story chapters are little adventures that read quickly.</p><p>So far, the people I’ve shown it to seem to like it. I can’t wait for you to see it.</p><div><br /></div><div>Buy <i>Faster</i>:</div><div><ul style="text-align: left;"><li><a href="https://order.shareit.com/cart/add?vendorid=200075619&PRODUCT[301017101]=1&languageid=1" target="_blank"><i>Faster</i> (PDF</a>)</li><li><a href="https://amzn.to/3HZwGDb" target="_blank"><i>Faster</i> (hardcover)</a></li></ul></div><div><p></p></div>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com0tag:blogger.com,1999:blog-2954359812249072053.post-106997693420471412021-10-01T12:46:00.003-05:002023-08-18T17:27:47.284-05:00How I Spent My COVID Vacation<p>I haven’t blogged in, what, ...forever. A couple of years.</p><p>I have been writing, though. Just not here. A <i>lot</i>, actually. Here’s some of the stuff I’ve done during my lapse here:</p><p></p><ul style="text-align: left;"><li>2020-01-28 – <a href="https://method-r.com/2020/01/28/opm-01/">“Solving the unsolvable performance problem”</a> (2 pages)</li><li>2020-02-14 – <a href="https://method-r.com/2020/02/14/intermittent/">“Method R Workbench: the pesky, intermittent performance problem”</a> (video 4:57) </li><li>2020-03-11 – <a href="https://method-r.com/2020/03/11/opm-02/">“Preventing the post-production performance problem”</a> (2 pages)</li><li>2020-04-23 – <a href="https://method-r.com/2020/04/23/opm-03/">“Better testing, better risk reduction”</a> (2 pages)</li><li>2020-05-07 – <a href="https://method-r.com/2020/05/07/doug/">“Some things you probably didn’t know about tracing (Dallas edition)”</a> (video 1:03:27)</li><li>2020-06-10 – <a href="https://method-r.com/2020/06/10/opm-04/">“Death to the health check… Long live the health check”</a> (2 pages)</li><li>2020-07-01 – <a href="https://method-r.com/2020/07/01/workbench-9-0-0-2/">Method R Workbench 9.0</a>, a huge new release of my company’s flagship software system. Since 2001, this software has grown from a <i>tkprof</i> replacement to a system for mining and managing 10,000s of trace files at once.</li><li>2020-07-01 – <a href="https://youtu.be/TYdjjMGJFMU">“Method R Workbench 9: a whole new way to see Oracle performance”</a> (video 5:36)</li><li>2020-08-26 – <a href="https://method-r.com/2020/08/26/some-things-you-probably-didnt-know-about-oracle-tracing-chicago-edition/">“Some things you probably didn’t know about tracing (Chicago edition)”</a> (video 1:07:34)</li><li>2021-01-19 – <a href="https://www.cmg.org/2021/01/impact2021-three-tricky-performance-problems-solved-with-oracle-trace-data-cary-millsap/">CMG IMPACT 2021 “Three tricky performance problems solved with Oracle trace data”</a> (ad video 6:12)</li><li>2021-08-09 – <a href="https://method-r.com/2021/08/09/trace-19-2-2/">Method R Trace 21.2</a>, a re-imagining of our trace file collector extension for Oracle SQL Developer.</li><li>2021-08-11 – <a href="https://method-r.com/2021/08/11/method-r-workbench-video-tips/">“Method R Workbench video tips”</a> (8 videos, each 2:21 or less)</li></ul><div>But the biggest reason of all: I’ve spent every spare moment outside of my work obligations since March 2020…</div><div><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><div style="text-align: left;"> <a href="https://www.youtube.com/watch?v=9mSVzGnKsXw" target="_blank"><span style="font-size: x-large;">…writing a new book.</span> </a></div></blockquote><div><br /></div><div>The working title is <i>How to Make Things Faster</i>. It’s a book about making things (including software) go faster, for readers who aren’t necessarily technical. It will be about the size of a Dilbert book and contain pretty much everything I’ve ever learned in 30 years of work, both technical <i>and</i> political. The audience I’m aiming for is every IT professional, business leader, and consultant on Earth. I hope you’ll be able to find it in airport book stores next to Liz Wiseman and Dr. Phil.</div><div><br /></div><div>The book is story-driven. You’ll get a fun story or two and then half a dozen bite-sized (~2½-page) chapters teaching lessons inspired by the stories, then a new story and more bite-sized lessons. I think that people will be able to enjoy reading the book both serially from front to back, and randomly two or three short chapters at a time. </div><div><br /></div><div>To ensure that the material would be accessible to non-technical readers, I hired a very special first reviewer for this project: my mom. My instructions to her were to identify anything that was either unclear or boring. Thanks to her help, other reviewers so far have characterized the book as “fun,” “lively,” “quick,” and “important.”</div><div><br /></div><div>It’s been a lot of work, and there’s still a lot to do. I’m excited about it, and I hope you’ll be, too. I’ll get it to you as soon as I can.</div><div><br /></div><div>If you want a peek, you should join me next Thursday, October 7 at the Dallas Oracle Users Group’s <a href="https://doug.org/doug-training-day-2021/">“DOUG Training Day 2021,”</a> which will convene <i>live </i>(!) in Grapevine, Texas, not too far from where I’m sitting right now. This will be an important event for me: it’ll be the first time I’ll have presented face-to-face with a live audience in nearly two years, and it’ll be the first time I’ll have presented material from the book. Plus, it’s a keynote for the event, so …the pressure’s on. :-)</div><div><br /></div><div>If you’re interested in the sound of the material, please consider booking me for a workshop.</div><div><br /></div><div><br /></div><p></p>Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com2tag:blogger.com,1999:blog-2954359812249072053.post-39920856067306168232019-07-23T09:44:00.001-05:002021-05-17T10:22:54.105-05:00Sometimes the Simplest Things Are the Most ImportantI didn’t ride in First Class a lot during my career, but I can remember one trip, I was sitting in seat 1B. Aisle seat, very front row. Right behind the lavatory bulkhead. The lady next to me in 1A was very nice, and we traded some stories.<br />
<br />
I can remember telling her during dinner, wow, just look at us. Sitting in an aluminum tube going 500 miles per hour, 40,000 feet off the ground. It’s 50º below zero out there. Thousands of gallons of kerosene are burning in huge cans bolted to our wings, making it all go. Yet here we sit in complete comfort, enjoying a glass of wine and a steak dinner. And just three feet away from us in that lavatory right there, a grown man is sitting on a toilet.<br />
<br />
I said, you know, out of all the inventions that have brought us to where we are here today, the very most important one is probably that wall.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com3tag:blogger.com,1999:blog-2954359812249072053.post-46077808176877327232017-08-15T18:25:00.000-05:002017-10-11T09:03:21.519-05:00Words I Don’t Use, Part 5: “Wait”The fifth “word I do not use” is the Oracle technical term <i>wait</i>.<br />
<h2>
The Oracle Wait Interface</h2>
In 1991, Oracle Corporation released some of the most important software instrumentation of all time: the “wait” statistics that were implemented in Oracle 7.0. Here’s part of the story, in <a href="https://www.oracle.com/corporate/executives/juan-loaiza.html" target="_blank">Juan Loaiza</a>’s words, as told in <a href="http://amzn.to/2bGSJ46"><i>Nørgaard et. al (2004), Oracle Insights: Tales of the Oak Table</i></a>.<br />
<blockquote class="tr_bq">
This stuff was developed because we were running a benchmark that we could not get to perform. We had spent several weeks trying to figure out what was happening with no success. The symptoms were clear—the system was mostly idle—we just couldn’t figure out why.<br />
<br />
We looked at the statistics and ratios and kept coming up with theories, the trouble was that none of them were right. So we wasted weeks tuning and fixing things that were not the problem. Finally we ran out of ideas and were forced to go back and instrument the code to figure out what the problem was.<br />
<br />
Once the waits were instrumented the problem was diagnosed in minutes. We were having “free buffer” waits because the DBWR was not writing blocks fast enough. It’s amazing how hard that was to figure out with statistics, and how easy it was to figure out once the waits were instrumented.<br />
<br />
...In retrospect a lot of the names could be greatly improved. The wait interface was added after the freeze date as a “stealth” project so it did not get as well thought through as it should have. Like I said, we were just trying to solve a problem in the course of a benchmark. The trouble is that so many people use this stuff now that if you change the names it will break all sorts of thing tools, so we have to leave them alone.</blockquote>
Before Juan’s team added this code, the Oracle kernel would show you only how much time its <i>user</i> calls (like <i>parse</i>, <i>exec</i>, and <i>fetch</i>) were taking. The new instrumentation, which included a set of <a href="http://docs.oracle.com/database/121/REFRN/GUID-4EDAB293-F3FC-40FE-BC75-4FEE6A4D7705.htm#REFRN30229" target="_blank">new fixed views like <i>v$session_wait</i></a> and <a href="http://amzn.to/2bzTJd0" target="_blank">new <code>WAIT</code> lines in our trace files</a>, showed how much time Oracle’s <a href="https://en.wikipedia.org/wiki/System_call"><i>system</i> calls (like reads, writes, and semops)</a> were taking.<br />
<h2>
The Working-Waiting Model</h2>
The wait interface begat a <a href="https://support.oracle.com/epmos/faces/DocContentDisplay?id=190124.1" target="_blank">whole new mental model about Oracle performance, based on the principle of <i>working</i> versus <i>waiting</i></a>:<br />
<blockquote class="tr_bq">
<a href="https://support.oracle.com/epmos/faces/DocContentDisplay?id=223117.1" target="_blank">Response Time = Service Time + Wait Time</a></blockquote>
In this formula, Oracle defines <i>service time</i> as the duration of the CPU used by your Oracle session (the duration Oracle spent <i>working</i>), and <i>wait time</i> as the sum of the durations of your Oracle wait events (the duration that Oracle spent <i>waiting</i>). Of course, <i>response time</i> in this formula means the duration spent inside the Oracle Database kernel.<br />
<h2>
Why I Don’t Say <i>Wait</i>, Part 1</h2>
There are two reasons I don’t use the word <i>wait</i>. The first is simply that it’s ambiguous.<br />
<br />
The Oracle formula is okay for talking about database time, but the scope of my attention is almost never just Oracle’s response time—I’m interested in the <i>business’s</i> response time. And when you think about the whole stack (which, of course you do; <a href="https://www.blogger.com/blogger.g?blogID=2954359812249072053">see holistic</a>), there are events we could call <i>wait events</i> all the way up and down:<br />
<ul>
<li>The customer <b>waits</b> for an answer from a user.</li>
<li>The user <b>waits</b> for a screen from the browser.</li>
<li>The browser <b>waits</b> for an HTML page from the application server.</li>
<li>The application server <b>waits</b> for a database call from the Oracle kernel.</li>
<li>The Oracle kernel <b>waits</b> for a system call from the operating system.</li>
<li>The operating system’s I/O request <b>waits</b> to clear the device’s queue before receiving service.</li>
<li>...</li>
</ul>
If I say <i>waits</i>, the users in the room will think I’m talking about application response time, the Oracle people will think I’m talking about Oracle system calls, and the hardware people will think I’m talking about device queueing delays. Even when I’m not.<br />
<h2>
Why I Don’t Say <i>Wait</i>, Part 2</h2>
There is a deeper problem with <i>wait</i> than just ambiguity, though. The word <i>wait</i> invites a mental model that <i>actually obscures your thinking about performance</i>.<br />
<br />
Here’s the problem: <i>waiting</i> sounds like something you’d want to avoid, and <i>working</i> sounds like something you’d want more of. Your program is <i>waiting</i>?! Unacceptable. You want it to be <i>working</i>. The connotations of the words <i>working</i> and <i>waiting</i> are unavoidable. It sounds like, if a program is waiting a lot, then you need to fix it; but if it’s working a lot, then it is probably okay. Right?<br />
<br />
<a href="https://method-r.com/2013/02/19/why-you-should-focus-on-lios-instead-of-pios/" target="_blank">Actually, no.</a><br />
<br />
The connotations “work is virtuous” and “waits are abhorrent” are <i>false</i> connotations in Oracle. One is not inherently better or worse than the other. <i>Working</i> and <i>waiting</i> are not accurate value judgments about Oracle software. On the contrary, they’re not even <i>meaningful</i>; they’re just arbitrary labels. We could just as well have been taught to say that an Oracle program is “working on disk I/O” and “waiting to finish its CPU instructions.”<br />
<br />
The terms <i>working</i> and <i>waiting</i> really just refer to different subroutine call types:<br />
<br />
<table style="margin-left: 2em;"><tbody>
<tr><td class="right nowrap">“Oracle is <i>working</i>”</td><td class="nowrap">means</td><td class="nowrap">“your Oracle kernel process is executing a <i>user</i> call”</td></tr>
<tr><td class="right nowrap">“Oracle is <i>waiting</i>”</td><td class="nowrap">means</td><td class="nowrap">“your Oracle kernel process is executing a <i>system</i> call”</td></tr>
</tbody></table>
<br />
The working-waiting model implies a distinction that does not exist, because these two call types have equal footing. One is no worse than the other, except by virtue of how much time it consumes. <i>It doesn’t matter whether a program is working or waiting; it only matters how long it takes.</i><br />
<h2>
Working-Waiting Is a Flawed Analogy</h2>
The working-waiting paradigm is a flawed analogy. I’ll illustrate. Imagine two programs that consume 100 seconds apiece when you run them:<br />
<br />
<table><thead>
<tr><td class="column-label" colspan="2"><b>Program A</b></td><td style="width: 4em;"></td><td class="column-label" colspan="2"><b>Program B</b></td></tr>
<tr><th class="number">Duration</th><th class="column-label">Call type</th><td></td><th class="number">Duration</th><th class="column-label">Call type</th></tr>
</thead> <tbody>
<tr><td class="number">98</td><td>system calls (waiting)</td><td></td><td class="number">98</td><td>user calls (working)</td></tr>
<tr><td class="number">2</td><td>user calls (working)</td><td></td><td class="number">2</td><td>system calls (waiting)</td></tr>
</tbody> <tfoot>
<tr><th class="number">100</th><th class="column-label">Total</th><td></td><th class="number">100</th><th class="column-label">Total</th></tr>
</tfoot> </table>
<br />
To improve program A, you should seek to eliminate unnecessary system calls, because that’s where most of A’s time has gone. To improve B, you should seek to <a href="https://method-r.com/2013/02/19/why-you-should-focus-on-lios-instead-of-pios/">eliminate unnecessary user calls</a>, because that’s where most of B’s time has gone. That’s it. <a href="https://method-r.com/Faq_quare/explain-method-r/" target="_blank">Your diagnostic priority shouldn’t be based on your calls’ names; it should be based solely on your calls’ contributions to total duration.</a> <i>Specifically, conclusions like, “Program B is okay because it doesn’t spend much time waiting,” are false.</i><br />
<h2>
A Better Model</h2>
I find that discarding the working-waiting model helps people optimize better. Here’s how you can do it. First, understand the substitute phrasing: <i>working</i> means executing a <i>user</i> call; and <i>waiting</i> means executing a <i>system</i> call. Second, understand that <a href="http://amzn.to/2uNVh7R" target="_blank">the excellent ideas people use to optimize other software</a> <a href="http://carymillsap.blogspot.com/2010/09/my-otn-interview-at-oow2010-which-hasnt.html" target="_blank">are excellent ideas for optimizing Oracle, too:</a><br />
<ol>
<li><a href="http://carymillsap.blogspot.com/2008/12/small-adventure-in-profiling.html" target="_blank">Any program’s duration is a function of all of its subroutine call durations (both user calls and system calls),</a> and</li>
<li><a href="https://carymillsap.blogspot.com/2015/02/what-happened-to-when-application-is.html" target="_blank">A program is running as fast as possible only when (1) its unnecessary calls have been eliminated, and (2) its necessary calls are running at hardware speed.</a></li>
</ol>
Oracle’s wait interface is vital because it helps us measure an Oracle program’s <i>complete</i> execution duration—not just Oracle’s <i>user</i> calls, but its <i>system</i> calls as well. But I avoid saying <i>wait</i> to help people steer clear of the incorrect bias introduced by the working-waiting analogy.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com5tag:blogger.com,1999:blog-2954359812249072053.post-75944183130626000342017-08-07T09:55:00.000-05:002017-08-07T16:12:46.681-05:00Words I Don’t Use, Part 4: “Expert”<div class="separator" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><a href="https://en.wikipedia.org/wiki/Nullius_in_verba"><img border="0" data-original-height="197" data-original-width="383" height="164" src="https://2.bp.blogspot.com/-d6lX33Xxscw/WXpPk02ltUI/AAAAAAAACQQ/tnbAjxUfLwYGWl_gR4WoJNfzlbHyK78UwCLcBGAs/s320/CA-Plate.png" width="320" /></a></div>The fourth “word I do not use” is <i>expert</i>.<br />
<br />
When I was a young boy, my dad would sometimes drive me to school. It was 17 miles of country roads and two-lane highways, so it gave us time to talk.<br />
<br />
At least once a year, and always on the first day of school, he would tell me, “Son, there are two answers to every test question. There’s the correct answer, and there’s the answer that the teacher expects. ...They’re not always the same.”<br />
<br />
He would continue, “And I expect you to know them <i>both</i>.”<br />
<br />
He wanted me to make perfect grades, but he expected me to understand <i>my responsibility</i> to know the difference between <i>authority</i> and <i>truth</i>. <a href="http://www.fotuva.org/feynman/what_is_science.html" target="_blank">My dad thus taught me from a young age to be skeptical of experts.</a><br />
<br />
The word <i>expert</i> always warns me of a potentially dangerous type of thinking. The word is used to confer authority upon the person it describes. But it’s <i>ideas</i> that are right or wrong; not <i>people</i>. You should evaluate an idea on its own merit, not on the merits of the person who conveys it. <a href="https://en.wikiquote.org/wiki/Arthur_C._Clarke" target="_blank">For every expert, there is an equal and opposite expert;</a> <a href="https://en.wikipedia.org/wiki/Clarke%27s_three_laws" target="_blank">but for every fact, there is not necessarily an equal and opposite fact.</a><br />
<br />
A big problem with <i>expert</i> is corruption—when self-congratulators hijack the label to confer authority upon themselves. But of course, misusing the word erodes the word. After too much abuse within a community, <i>expert</i> makes sense only with finger quotes. It becomes a word that critical thinkers use only ironically, to describe people they want to avoid.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com6tag:blogger.com,1999:blog-2954359812249072053.post-65841936519056720832017-07-29T10:24:00.000-05:002017-07-29T10:24:02.563-05:00Words I Don’t Use, Part 3: “Best Practice”The third “word I do not use” is <i>best practice</i>.<br />
<br />
The “best practice” serves a vital need in any industry. It is the answer to, “Please don’t make me learn about this; just tell me what to <i>do</i>.” The “best practice” is a fine idea in spirit, but here’s the thing: many practices labeled “best” don’t deserve the adjective. They’re often containers for bad advice.<br />
<br />
The most common problem with “best practices” is that they’re not parameterized like they should be. A good practice usually <i>depends</i> on something: <i>if</i> this is true, <i>then</i> do that; <i>otherwise</i>, do this other thing. But most “best practices” don’t come with conditions of execution—they often contain no <i>if</i> statements at all. They come disguised as recipes that can save you time, but they often encourage you to skip past thinking about things that you really ought to be thinking about.<br />
<br />
Most of my objections to “best practices” go away when the practices being prescribed are actually good. But the ones I see are often not, like the old SQL “avoid full-table scans” advice. Enforcing practices like this yields applications that don’t run as well as they should and developers that don’t learn the things they should. Practices like “Measure the efficiency of your SQL at every phase of the software life cycle,” are actually “best”-worthy, but alas, they’re less popular because they sound like real work.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com6tag:blogger.com,1999:blog-2954359812249072053.post-59225482263398469442017-07-27T11:51:00.001-05:002017-07-27T11:51:32.017-05:00Words I Don’t Use, Part 2: “Holistic”The second “word I do not use” is <i>holistic</i>.<br />
<br />
When people use the word “holistic” in my industry (Oracle), it means that they’re paying attention to not just an individual subcomponent of a system, but to a whole system, including (I hope) even the people it serves.<br />
<br />
But trying to differentiate technology services by saying “we take a holistic view of your system” is about like differentiating myself by saying I’ll wear clothes to work. Saying “holistic” would make it look like I’ve only just recently become aware that optimizing a system’s individual subsystems is not a reliable way to optimize the system itself. <i>This</i> should not be a distinctive revelation.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com1tag:blogger.com,1999:blog-2954359812249072053.post-16630396976158322422017-07-21T12:58:00.000-05:002017-07-21T12:58:03.787-05:00Words I Don’t Use, Part 1: “Methodology”Today, I will begin a brief sequence of blog posts that I’ll call “Words I Don’t Use.” I hope you’ll have some fun with it, and maybe find a thought or two worth considering.<br />
<br />
<a href="http://www.cafepress.com/mf/95125254/method-not-methodology_tshirt?productId=1450646280" target="_blank"><img border="0" data-original-height="762" data-original-width="642" height="320" src="https://3.bp.blogspot.com/-BX0Ni9GsPT4/WXI0mZ4FIqI/AAAAAAAACP4/bcc6D_GZirUMRXAORQds-EAqvcTvdT11ACLcBGAs/s320/2017-07-21_12-05-28.png" style="float: right;" width="269" /></a>The first word I’ll discuss is <i>methodology</i>. <a href="http://www.cafepress.com/mf/95125254/method-not-methodology_tshirt?productId=1450646280" target="_blank">Yes. I made a shirt about it.</a><br />
<br />
Approximately 100% of the time in the [mostly non-scientific] Oracle world that I live in, when people say “methodology,” they’re using it in the form that <a href="https://books.google.com/books?id=xb6ie6PqYhwC&lpg=PA299&ots=25Yhafdrlb&dq=american%20heritage%20methodology%20pretentious%20substitute&pg=PA299#v=onepage&q=american%20heritage%20methodology%20pretentious%20substitute&f=false" target="_blank"><i>American Heritage</i> describes as a pretentious substitute for “method.”</a> But methodology is not the same as method. <i>Methods</i> are processes. Sequences of steps. <i>Methodology</i> is the scientific study of methods.<br />
<br />
I like this article called <a href="https://organizationsandmarkets.com/2007/04/07/method-versus-methodology/" target="_blank">“Method versus Methodology” by Peter Klein</a>, which cites the same <i>American Heritage Dictionary</i> passage that I quoted on page 358 of <i><a href="http://amzn.to/173bpzg" target="_blank">Optimizing Oracle Performance</a></i>.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com7tag:blogger.com,1999:blog-2954359812249072053.post-46084457373583917792016-05-19T14:51:00.000-05:002017-08-07T16:28:59.830-05:00Messed-Up App of the Day: Tables of NumbersQuick, which database is the biggest space consumer on this system?<br />
<pre>Database Total Size Total Storage
-------------------- --------------- ---------------
SAD99PS 635.53 GB 1.24 TB
ANGLL 9.15 TB 18.3 TB
FRI_W1 2.14 TB 4.29 TB
DEMO 6.62 TB 13.24 TB
H111D16 7.81 TB 15.63 TB
HAANT 1.1 TB 2.2 TB
FSU 7.41 TB 14.81 TB
BYNANK 2.69 TB 5.38 TB
HDMI7 237.68 GB 476.12 GB
SXXZPP 598.49 GB 1.17 TB
TPAA 1.71 TB 3.43 TB
MAISTERS 823.96 GB 1.61 TB
p17gv_data01.dbf 800.0 GB 1.56 TB</pre>It’s harder than it looks.<br />
<br />
Did you come up with ANGLL? If you didn’t, then you should look again. If you did, then what steps did you have to execute to find the answer?<br />
<br />
I’m guessing you did something like I did:<br />
<ol><li>Skim the entire list. Notice that HDMI7 has a really big value in the third column.</li>
<li>Read the column headings. Parse the difference in meaning between “size” and “storage.” Realize that the “storage” column is where the answer to a question about space consumption will lie.</li>
<li>Skim the “Total Storage” column again and notice that the wide “476.12” number I found previously has a GB label beside it, while all the other labels are TB.</li>
<li>Skim the table again to make sure there’s no PB in there.</li>
<li>Do a little arithmetic in my head to realize that a TB is 1000× bigger than a GB, so 476.12 is probably not the biggest number after all, in spite of how big it looked.</li>
<li>Re-skim the “Total Storage” column looking for big TB numbers.</li>
<li>The biggest-looking TB number is 15.63 on the H111D16 row.</li>
<li>Notice the trap on the ANGLL row that there are only three significant digits showing in the “18.3” figure, which looks physically the same size as the three-digit figures “1.24” and “4.29” directly above and below it, but realize that 18.3 (which should have been rendered “18.30”) is an order of magnitude larger.</li>
<li>Skim the column again to make sure I’m not missing another such number.</li>
<li>The answer is ANGLL.</li>
</ol>That’s a lot of work. Every reader who uses this table to answer that question has to do it.<br />
<br />
Rendering the table differently makes your readers’ (plural!) job much easier:<br />
<pre>Database Size (TB) Storage (TB)
---------------- --------- ------------
SAD99PS .64 1.24
ANGLL 9.15 18.30
FRI_W1 2.14 4.29
DEMO 6.62 13.24
H111D16 7.81 15.63
HAANT 1.10 2.20
FSU 7.41 14.81
BYNANK 2.69 5.38
HDMI7 .24 .48
SXXZPP .60 1.17
TPAA 1.71 3.43
MAISTERS .82 1.61
p17gv_data01.dbf .80 1.56</pre>This table obeys an important design principle:<br />
<blockquote class="tr_bq"><b>The <a href="https://en.wikipedia.org/wiki/Edward_Tufte">amount of ink</a> it takes to render each number is proportional to its relative magnitude</b>.</blockquote>I fixed two problems: (i) now all the units are consistent (I have guaranteed this feature by adding unit label to the header and deleting all labels from the rows); and (ii) I’m showing the same number of significant digits for each number. Now, you don’t have to do arithmetic in your head, and now you can see more easily that the answer is ANGLL, at 18.30 TB.<br />
<br />
Let’s go one step further and finish the deal. If you really want to make it as easy as possible for readers to understand your space consumption problem, then you should sort the data, too:<br />
<pre>Database Size (TB) Storage (TB)
---------------- --------- ------------
ANGLL 9.15 18.30
H111D16 7.81 15.63
FSU 7.41 14.81
DEMO 6.62 13.24
BYNANK 2.69 5.38
FRI_W1 2.14 4.29
TPAA 1.71 3.43
HAANT 1.10 2.20
MAISTERS .82 1.61
p17gv_data01.dbf .80 1.56
SAD99PS .64 1.24
SXXZPP .60 1.17
HDMI7 .24 .48</pre>Now, your answer comes in a glance. Think back at the comprehension steps that I described above. With the table here, you only need:<br />
<ol><li>Notice that the table is sorted in descending numerical order.</li>
<li>Comprehend the column headings.</li>
<li>The answer is ANGLL.</li>
</ol>As a reader, you have executed <i>far</i> less code path in your brain to completely comprehend the data that the author wants you to understand.<br />
<br />
Good design is a topic of consideration. And even <i>conservation</i>. If spending 10 extra minutes formatting your data better saves 1,000 readers 2 minutes each, then you’ve saved the world 1,990 minutes of wasted effort.<br />
<br />
But good design is also a very practical matter for you personally, too. If you want your audience to understand your work, then make your information easier for them to consume—whether you’re writing email, proposals, reports, infographics, slides, or software. It’s part of the pathway to being more persuasive.<br />
<br />
Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com1tag:blogger.com,1999:blog-2954359812249072053.post-34792943588177405632016-05-13T17:22:00.001-05:002016-05-13T17:22:33.202-05:00Fail FastAmong movements like <a href="https://en.wikipedia.org/wiki/Agile_software_development">Agile</a>, <a href="https://en.wikipedia.org/wiki/Lean_startup">Lean Startup</a>, and <a href="https://en.wikipedia.org/wiki/Design_thinking">Design Thinking</a> these days, you hear the term <em>fail fast</em>. The principle of <em>failing fast</em> is vital to efficiency, but I’ve seen project managers and business partners be offended or even agitated by the term <em>fail fast</em>. I’ve seen it come out like, “Why the hell would I want to <em>fail fast</em>?! I don’t want to fail <em>at all</em>.” The implication, of course: “Failing is for losers. If you’re planning to fail, then I don’t want you on my team.”<br />
<br />
I think I can help explain why the principle of “fail fast” is so important, and maybe I can help you explain it, too.<br />
<br />
Software developers know about <em>fail fast</em> already, whether they realize it or not. Yesterday was a prime example for me. It was a really long day. I didn’t leave my office until after 9pm, and then I turned my laptop back on as soon as I got home to work another three hours. I had been fighting a bug all afternoon. It was a program that ran about 90 seconds normally, but when I tried a code path that should have been much faster, I could let it run 50 times that long and it <em>still</em> wouldn’t finish.<br />
<br />
At home, I ran it again and left it running while I watched the <a href="http://www.nba.com/games/20160512/SASOKC/gameinfo.html?ls=eref:google:1b:post">Thunder beat the Spurs</a>, assuming the program would finish eventually, so I could see the log file (which we’re not flushing often enough, which is another problem). My MacBook Pro ran so hard that the fan compelled my son to ask me why my laptop was suddenly so loud. I was wishing the whole time, “I wish this thing would fail faster.” And there it is.<br />
<br />
When you know your code is destined to fail, you want it to fail <em>faster</em>. Debugging is hard enough as it is, without your stupid code forcing you to wait an hour just to see your log file, so you might gain an idea of what you need to go fix. If I could fail faster, I could fix my problem earlier, get more work done, and ship my improvements sooner.<br />
<br />
But how does that relate to wanting my <em>business idea</em> to fail faster? Well, imagine that a given business idea is in fact destined to fail. When would you rather find out? (a) In a week, before you invest millions of dollars and thousands of hours investing into the idea? Or (b) In a year, after you’ve invested millions of dollars and thousands of hours?<br />
<br />
I’ll take option (a) a million times out of a million. It’s like asking if I’d like a crystal ball. Um, <em>yes</em>.<br />
<br />
The operative principle here is “destined to fail.” When I’m fixing a reported bug, I know that once I create reproducible test case for that bug, my software will fail. It is <em>destined to fail</em> on that test case. So, of course, I want for my process of creating the reproducible test case, my software build process, and my program execution itself to all happen as fast as possible. Even better, I wish I had come up with the reproducible test case a year or two ago, so I wouldn’t be under so much pressure <em>now</em>. Because seeing the failure earlier—<em>failing fast</em>—will help me improve my product earlier.<br />
<br />
But back to that business idea... Why would you want a business idea to <em>fail fast</em>? Why would you want it to fail at all? Well, of course, you don’t want it to fail, but it doesn’t matter what you want. What if it is <em>destined</em> to fail? It’s really important for you to <i>know</i> that. So how can you know?<br />
<br />
Here’s a little trick I can teach you. Your business idea <em>is</em> destined to fail. It is. No matter how awesome your idea is, if you implement your current vision of some non-trivial business idea that will take you, say, a month or more to implement, not refining or evolving your original idea at all, your idea will fail. It will. Seriously. If your brain won’t permit you to conceive of this as a possibility, then your brain is actually increasing the probability that your idea will fail. <br />
<br />
You need to figure out <em>what will make your idea fail</em>. If you can’t find it, then find smart people who can. Then, don’t fear it. Don’t try to pretend that it’s not there. Don’t work for a year on the easy parts of your idea, delaying the inevitable hard stuff, hoping and praying that the hard stuff will work its way out. Attack that hard stuff first. That takes courage, but you need to do it.<br />
<br />
Find your worst bottleneck, and make it your highest priority. If you cannot solve your idea’s worst problem, then get a new idea. You’ll do yourself a favor by killing a bad idea before it kills you. If you solve your worst problem, then find the next one. Iterate. Shorter iterations are better. You’re done when you’ve proven that your idea actually works. In reality. And then, because life keeps moving, you have to keep iterating.<br />
<br />
That’s what <em>fail fast</em> means. It’s about shortening your feedback loop. It’s about learning the most you can about the most important things you need to know, as soon as possible.<br />
<br />
So, when I wish you <em>fail fast</em>, it’s a blessing; not a curse.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com2tag:blogger.com,1999:blog-2954359812249072053.post-48813971881969079712016-03-07T14:16:00.001-06:002021-03-03T11:25:37.667-06:00Loss Aversion and the Setting of DB_BLOCK_CHECKSUMWithin <a href="https://www.enkitec.com/">Accenture Enkitec Group,</a> we have recently been discussing the Oracle <i>db_block_checksum</i> parameter and how difficult it is to get clients to set it to a safer setting.<br />
<br />
Clients are always concerned about the performance impact of features like this. Several years ago, I met a lot of people who had—in response to some expensive advice with which I strongly disagreed—turned off redo logging with an underscore parameter. The performance they would get from doing this would set the expectation level in their mind, which would cause them to resist (strenuously!) any notion of switching this [now horribly expensive] logging back on. Of course, it makes you wish that it had never even been a parameter.<br />
<br />
I believe that the right analysis is to think clearly about <i>risk</i>. Risk is a non-technical word in most people’s minds, but in finance courses they teach that risk is quantifiable as a probability distribution. For example, you can calculate the probability that a disk will go bad in your system today. For disks, it’s not too difficult, because vendors do those calculations (MTTF) for us. But the probability that you’ll wish you had set <i>db_block_checksum=full</i> yesterday is probably more difficult to compute.<br />
<br />
From a psychology perspective, customers would be happier if their systems had <i>db_block_checksum</i> set to <i>full</i> or <i>typical</i> to begin with. Then in response to the question,<br />
<blockquote class="tr_bq">
“Would you like to remove your safety net in exchange for going between 1% and 10% faster? Here’s the horror you might face if you do it...”</blockquote>
...I’d wager that most people would say no, thank you. They will react emotionally to the idea of their safety net being taken away.<br />
<br />
But with the baseline of its being turned off to begin with, the question is,<br />
<blockquote class="tr_bq">
“Would you like to install a safety net in exchange for slowing your system down between 1% and 10%? Here’s the horror you might face if you don’t...”</blockquote>
...I’d wager that most people would answer no, thank you, even though this verdict is opposite to the one I predicted above. They will react emotionally to the idea of their performance being taken away.<br />
<br />
Most people have a strong propensity toward <a href="https://en.wikipedia.org/wiki/Loss_aversion">loss aversion</a>. They tend to prefer avoiding losses over acquiring gains. If they already have a safety net, they won’t want to lose it. If they don’t have the safety net they need, they’ll feel averse to losing performance to get one. It ends up being a problem more about psychology than technology.<br />
<br />
The only tools I know to help people make the right decision are:<br />
<ol>
<li>Talk to good salespeople about how they overcome the psychology issue. They have to deal with it every day.</li>
<li>Give concrete evidence. Compute the probabilities. Tell the stories of how bad it is to have insufficient protection. Explain that any software feature that provides a benefit is going to cost some system capacity (just like a new report, for example), and that this safety feature is worth the cost. Make sure that when you size systems, you include the incremental capacity cost of switching to <i>db_block_checksum=full</i>.</li>
</ol>
My teammates get it, of course, because they’ve lived the stories, over and over again, in their roles on the corruption team at Oracle Support. You can get it, too, without leaving your keyboard. If you want to see <a href="https://davidloinaz.wordpress.com/2016/02/24/db_block_checksum-and-risk-perception/">a fantastic and absolutely horrifying short story about what happens if you do not use Oracle’s <i>db_block_checksum</i> feature properly, read David Loinaz’s article</a> now.<br />
<br />
When you read <a href="https://davidloinaz.wordpress.com/2016/02/24/db_block_checksum-and-risk-perception/">David’s article</a>, you are going to see heavy quoting of my post here in his intro. He did that with my full support. (He wrote his article when my article here wasn’t an article yet.) If you feel like you’ve read it before, just keep reading. You really, really need to see what David has written, beginning with the question:<br />
<blockquote class="tr_bq">
<a href="https://davidloinaz.wordpress.com/2016/02/24/db_block_checksum-and-risk-perception/">If I’ve never faced a corruption, and I have good backup strategy, my disks are mirrored, and I have a great database backup strategy, then why do I need to set these kinds of parameters that will impact my performance?</a></blockquote>
Enjoy.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com1tag:blogger.com,1999:blog-2954359812249072053.post-16810911682295458842016-01-08T14:21:00.000-06:002016-01-08T23:13:48.337-06:00The “Two Spaces After a Period” ThingOnce upon a time, I told my friend <a href="http://www.oraclenerd.com/">Chet Justice</a> why he should start using one space instead of two after a sentence-ending period. I’m glad I did.<br />
<br />
Here’s the story.<br />
<br />
When you type, you’re inputting data into a machine. I know you like feeling like you’re in charge, but really you’re not in charge of all the rules you have to follow while you’re inputting your data. Other people—like the designers of the machine you’re using—have made certain rules that you have to live by. For example, if you’re using a QWERTY keyboard, then the ‘A’ key is in a certain location on the keyboard, and whether it makes any sense to you or not, the ‘B’ key is way over there, not next to the ‘A’ key like you might have expected when you first started learning how to type. If you want a ‘B’ to appear in the input, then you have to reach over there and push the ‘B’ key on the keyboard.<br />
<br />
In addition to the rules imposed upon you by the designers of the machine you’re using, you follow other rules, too. If you’re writing a computer program, then you have to follow the syntax rules of the language you’re using. There are alphabet and spelling and grammar rules for writing in German, and different ones for English. There are typographical rules for writing for <a href="http://www.newyorker.com/">The New Yorker</a>, and different ones for the <a href="http://www.ams.org/home/page">American Mathematical Society</a>.<br />
<br />
A lot of people who are over about 40 years old today learned to type on an actual typewriter. A typewriter is a machine that used rods and springs and other mechanical elements to press metal dies with backwards letter shapes engraved onto them through an inked ribbon onto a piece of paper. Some of the rules that governed the data input experience on typewriters included:<br />
<ul>
<li>You had to learn where the keys were on the keyboard.</li>
<li>You had to learn how to physically return the carriage at the end of a line.</li>
<li>You had to learn your project’s rules of spelling.</li>
<li>You had to learn your project’s rules of grammar.</li>
<li>You had to learn your project’s rules of typography.</li>
</ul>
The first two rules listed here are physical, but the final three are syntactic and semantic. Just like you wouldn’t press the ‘A’ key to make a ‘B’, you wouldn’t use the strings “definately” or “we was” to make an English sentence.<br />
<br />
On your typewriter, you might not have realized it, but you did adhere to some typography rules. They might have included:<br />
<ul>
<li>Use two carriage returns after a paragraph.</li>
<li>Type two spaces after a sentence-ending period.</li>
<li>Type two spaces after a colon.</li>
<li>Use two consecutive hyphens to represent an em dash.</li>
<li>Make paragraphs no more than 80 characters wide.</li>
<li>Never use a carriage return between “Mr.” and the proper name that follows, or between a number and its unit.</li>
</ul>
The rules were different for different situations. For example, when I wrote a book back in the mid 1980s, one of the distinctive typography rules my publisher imposed upon me was:<br />
<ul>
<li>Double-space all paragraph text.</li>
</ul>
They wanted their authors to do this so that their copyeditor had plenty of room for <a href="http://biostatmatt.com/uploads/ProofreadSymbols.pdf">markup</a>. Such typography rules can vary from one project to another.<br />
<br />
Most people who didn’t write for different publishers got by just fine on the one set of typography rules they learned in high school. To them, it looked like there were only a few simple rules, and only one set of them. Most people had never even heard of a lot of the rules they should have been following, like <a href="http://www.fonts.com/content/learning/fontology/level-2/text-typography/rags-widows-orphans">rules about widows and orphans</a>.<br />
<br />
In the early 1980s, I began using computers for most of my work. I can remember learning how to use word processing programs like <a href="https://en.wikipedia.org/wiki/WordStar">WordStar</a> and <a href="https://en.wikipedia.org/wiki/Sprint_(word_processor)">Sprint</a>. The rules were a lot more complicated with word processors. Now there were rules about “control keys” like ^X and ^Y, and there were no-break spaces and styles and leading and kerning and ligatures and all sorts of new things I had never had to think about before. A word processor was much more powerful than a typewriter. If you did it right, typesetting could could make your work look like a real book. But word processors revealed that typesetting was way more complicated than just typing.<br />
<br />
Doing your own typesetting can be kind of like doing your own oil changes. Most people prefer to just put gas in the tank and not think too much about the esoteric features of their car (like their tires or their turn signal indicators). Most people who went from typewriters to word processors just wanted to type like they always had, using the good-old two or three rules of typography that had been long inserted into their brains by their high school teachers and then committed by decades of repetition.<br />
<br />
Donald Knuth published <i><a href="http://amzn.to/1OgAbSY">The TeXBook</a></i> in 1984. I think I bought it about ten minutes after it was published. Oh, I loved that book. Using TeX was my first real exposure to the world of actual professional-grade typography, and I have enjoyed thinking about typography ever since. I practice typography every day that I use <a href="https://en.wikipedia.org/wiki/Keynote_(presentation_software)">Keynote</a> or <a href="https://en.wikipedia.org/wiki/Pages_(word_processor)">Pages</a> or <a href="https://en.wikipedia.org/wiki/Adobe_InDesign">InDesign</a> to do my work.<br />
<br />
Many people don’t realize it, but when you type input into programs like Microsoft Word should follow typography rules including these:<br />
<ul>
<li>Never enter a blank line (edit your paragraph’s style to manipulate its spacing).</li>
<li>Use a single space after a sentence-ending period (the typesetter software you’re using will make the amount of space look right as it composes the paragraph).</li>
<li>Use a non-breaking space after a non-sentence-ending period (so the typesetter software won’t break “Mr. Harkey” across lines).</li>
<li>Use a non-breaking space between a number and its unit (so the typesetter software won’t break “8 oz” across lines).</li>
<li>Use an en dash—not a hyphen—to specify ranges of numbers (like “3–8”).</li>
<li>Use an em dash—not a pair of hyphens—when you need an em dash (like in this sentence).</li>
<li>Use proper quotation marks, like “this” and ‘this’ (or even « this »).</li>
</ul>
Of course, you can choose to not follow these rules, just like you can choose to be willfully ignorant about spelling or grammar. But to a reader who has studied typography even just a little bit, seeing you break these rules feels the same as seeing a sentence like, “You was suppose to use apostrophe's.” It affects how people perceive you.<br />
<br />
So, it’s always funny to me when people get into heated arguments on Facebook about using one space or two after a period. It’s the tiniest little tip of the typography iceberg, but it opens the conversation about typography, for which I’m glad. In these discussions, two questions come up repeatedly: “When did the rule change? Why?”<br />
<br />
Well, the rule never did change. The next time I type on an actual typewriter, I will use two spaces after each sentence-ending period. I will also use two spaces when I create a Courier font court document or something that I want to look like it was created in the 1930s. But when I work on <a href="http://method-r.com/">my book</a> in Adobe InDesign, I’ll use one space. When I use my iPhone, I’ll tap in two spaces at the end of a sentence, because it automatically replaces them with a period and a single space. I adapt to the rules that govern the situation I’m in.<br />
<br />
It’s not that the rules have changed. It’s that the set of rules was always a lot bigger than most people ever knew.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com10tag:blogger.com,1999:blog-2954359812249072053.post-8050761589162165242015-10-01T17:23:00.000-05:002015-10-28T16:50:10.343-05:00What I Wanted to Tell Terry BradshawI met <a href="https://en.wikipedia.org/wiki/Terry_Bradshaw">Terry Bradshaw</a> one time. It was about ten years ago, in front of a movie theater near where I live.<br />
<br />
When I was little, Terry Bradshaw was my enemy because, unforgivably to a young boy, he and his Pittsburgh Steelers <a href="https://en.wikipedia.org/wiki/Cowboys%E2%80%93Steelers_rivalry">kept beating</a> my beloved Dallas Cowboys in Super Bowls. As I grew up, though, his personality on TV talk shows won me over, and I enjoy watching him to this day on <a href="https://en.wikipedia.org/wiki/Fox_NFL_Sunday">Fox NFL Sunday</a>. After learning a little bit about his life, I’ve grown to really admire and respect him.<br />
<br />
I had heard that he owned a ranch not too far from where I live, and so I had it in mind that inevitably I would meet him someday, and I would say thank you. One day I had that chance.<br />
<br />
I completely blew it.<br />
<br />
My wife and I saw him there at the theater one day, standing by himself not far from us. It seemed like if I were to walk over and say hi, maybe it wouldn’t bother him. So I walked over, a little bit nervous. I shook his hand, and I said, “Mr. Bradshaw, hi, my name is Cary.” I would then say this:<br />
<br />
<blockquote>
I was a big Roger Staubach fan growing up. I watched Cowboys vs. Steelers like I was watching Good vs. Evil. <br />
<br />
But as I’ve grown up, I have gained the deepest admiration and respect for you. You were a tremendous competitor, and you’re one of my favorite people to see on TV. Every time I see you, you bring a smile to my face. You’ve brought joy to a lot of people.<br />
<br />
I just wanted to say thank you.</blockquote>
<br />
Yep, that’s what I would say to Terry Bradshaw if I got the chance. But that’s not how it would turn out. How it actually went was like this, …my big chance:<br />
<br />
<blockquote>
Me: I was a big Roger Staubach fan growing up.<br />
TB: Hey, so was I!<br />
Me: (stunned)<br />
TB: (turns away)<br />
<i>The End</i></blockquote>
<br />
I was heartbroken. It bothers me still today. If you know Terry Bradshaw or someone who does, I wish you would please let him know. It would mean a lot to me.<br />
<br />
…I did learn something that day about <a href="https://en.wikipedia.org/wiki/Elevator_pitch">the elevator pitch</a>.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com2tag:blogger.com,1999:blog-2954359812249072053.post-54738037331324954152015-09-17T11:46:00.000-05:002016-06-08T16:00:36.312-05:00The Fundamental Challenge of Computer System PerformanceThe fundamental challenge of computer system performance is <b>for your system to have enough power to handle the work you ask it to do.</b> It sounds really simple, but helping people meet this challenge has been the point of my whole career. It has kept me busy for 26 years, and there’s no end in sight.<br />
<h2>
Capacity and Workload</h2>
Our challenge is the relationship between a computer’s <i>capacity</i> and its <i>workload</i>. I think of capacity as an empty box representing a machine’s ability to do work over time. <i>Workload</i> is the work your computer does, in the form of programs that it runs for you, executed over time. Workload is the content that can fill the capacity box.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-gSIZhbWA2k8/VfiXd5KOgwI/AAAAAAAACBU/jt8i8LWexl8/s1600/capacity.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="https://1.bp.blogspot.com/-gSIZhbWA2k8/VfiXd5KOgwI/AAAAAAAACBU/jt8i8LWexl8/s320/capacity.png" style="border: 0;" width="320" /></a></div>
<br />
<h2>
Capacity Is the One You Can Control, Right?</h2>
When the workload gets too close to filling the box, what do you do? Most people’s instinctive reaction is that, well, we need a bigger box. Slow system? Just add power. It sounds so simple, especially since—as “everyone knows”—computers get faster and cheaper every year. We call that the <i>KIWI</i> response: <i>kill it with iron.</i><br />
<h2>
KIWI... Why Not?</h2>
As welcome as KIWI may feel, KIWI is expensive, and it doesn’t always work. Maybe you don’t have the budget right now to upgrade to a new machine. Upgrades cost more than just the hardware itself: there’s the time and money it takes to set it up, test it, and migrate your applications to it. Your software may cost more to run on faster hardware. What if your system is already the biggest and fastest one they make?<br />
<br />
And as weird as it may sound, upgrading to a more powerful computer doesn’t always make your programs run faster. There are classes of performance problems that adding capacity <i>never</i> solves. (Yes, it is possible to predict when that will happen.) KIWI is not always a viable answer.<br />
<h2>
So, What Can You Do?</h2>
Performance is not just about capacity. Though many people overlook them, there are solutions on the <i>workload</i> side of the ledger, too. What if you could make workload smaller without compromising the value of your system?<br />
<blockquote>
It is usually possible to make a computer produce all of the useful <i>results</i> that you need without having to do as much <i>work</i>.</blockquote>
You might be able to make a system run faster by making its capacity box bigger. But you might also make it run faster by trimming down that big red workload inside your existing box. If you only trim off the wasteful stuff, then nobody gets hurt, and you’ll have winning all around.<br />
<br />
So, <i>how</i> might one go about doing that?<br />
<h2>
Workload</h2>
“Workload” is a conjunction of two words. It is useful to think about those two words separately.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-5OAGa5GeK6U/Vfm9hg5siuI/AAAAAAAACBs/3idfbUIpw44/s1600/workload.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-5OAGa5GeK6U/Vfm9hg5siuI/AAAAAAAACBs/3idfbUIpw44/s1600/workload.png" style="border: 0;" /></a></div>
<br />
The amount of <i>work</i> your system does for a given program execution is determined mostly by how that program is written. <a href="https://en.wikipedia.org/wiki/Program_optimization">A lot of programs make their systems do more work than they should</a>. Your <i>load</i>, on the other hand—the number of program executions people request—is determined mostly by your users. Users can waste system capacity, too; for example, by running reports that nobody ever reads.<br />
<br />
Both work and load are variables that, with skill, you can manipulate to your benefit. You do it by improving the code in your programs (reducing work), or by improving your business processes (reducing load). I like workload optimizations because they usually save money and work better than capacity increases. Workload optimization can seem like magic.<br />
<h2>
The Anatomy of Performance</h2>
This simple equation explains why a program consumes the time it does:<br />
<blockquote>
<var>r</var> = <var>cl</var> or <var>response time</var> = <var>call count</var> × <var>call latency</var></blockquote>
Think of a <i>call</i> as a computer instruction. <i>Call count</i>, then, is the number of instructions that your system executes when you run a program, and <i>call latency</i> is how long each instruction takes. How long you wait for your answer, then—your <i>response time</i>—is the product of your call count and your call latency.<br />
<br />
<div style="font-size: 7pt; margin-left: 3em; margin-right: 3em;">
<i>Some fine print:</i> It’s really a little more complicated than this, but actually not that much. Most response times are composed of many different types of calls, all of which have different latencies (we see these in <a href="http://method-r.com/software/profiler">program execution profiles</a>), so the real equation looks like <var>r</var> = <var>c</var><sub>1</sub><var>l</var><sub>1</sub> + <var>c</var><sub>2</sub><var>l</var><sub>2</sub> + ... + <var>c<sub>n</sub>l<sub>n</sub></var>. But we’ll be fine with <var>r</var> = <var>c</var><var>l</var> for this article.</div>
<br />
<i>Call count</i> depends on two things: how the code is written, and how often people run that code.<br />
<ul>
<li><i>How the code is written (work)</i> — If you were programming a robot to shop for you at the grocery store, you could program it to make one trip from home for each item you purchase. Go get bacon. Come home. Go get milk... It would probably be dumb if you did it that way, because the duration of your shopping experience would be dominated by the execution of clearly unnecessary travel instructions, but you’d be surprised at how often people write programs that act like this.</li>
<li><i>How often people run that code (load)</i> — If you wanted your grocery store robot to buy 42 things for you, it would have to execute more instructions than if you wanted to buy only 7. If you found yourself repeatedly discarding spoiled, unused food, you might be able to reduce the number of things you shop for without compromising anything you really need.</li>
</ul>
<i>Call latency</i> is influenced by two types of delays: queueing delays and coherency delays.<br />
<ul>
<li><i>Queueing delays</i> — Whenever you request a resource that is already busy servicing other requests, you wait in line. That’s a queueing delay. It’s what happens when your robot tries to drive to the grocery store, but all the roads are clogged with robots that are going to the store to buy one item at a time. Driving to the store takes only 7 minutes, but waiting in traffic costs you another 13 minutes. The more work your robot does, the greater its chances of being delayed by queueing, and the more such delays your robot will inflict upon others as well.</li>
<li><i>Coherency delays</i> — You endure a coherency delay whenever a resource you are using needs to communicate or coordinate with another resource. For example, if your robot’s cashier at the store has to talk with a specific manager or other cashier (who might already be busy with a customer), the checkout process will take longer. The more times your robot goes to the store, the worse your wait will be, and everyone else’s, too.</li>
</ul>
<h2>
The Secret</h2>
This <var>r</var> = <var>cl</var> thing sure looks like the equation for a line, but because of queueing and coherency delays, the value of <var>l</var> increases when <var>c</var> increases. This causes response time to act <i>not</i> like a line, but instead like a hyperbola.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/--rlnJHiZLxY/V1iHYYhO2YI/AAAAAAAACJw/nbVhRVjWxzoyibnLe5WsgDKaAGwTvil8ACLcB/s1600/r%253Dcl.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://1.bp.blogspot.com/--rlnJHiZLxY/V1iHYYhO2YI/AAAAAAAACJw/nbVhRVjWxzoyibnLe5WsgDKaAGwTvil8ACLcB/s320/r%253Dcl.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Because <a href="http://www.amazon.com/gp/product/0201479486/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0201479486&linkCode=as2&tag=methodrcom-20&linkId=HPUTBI5W6TFV3VF2">our brains tend to conceive of our world as linear</a>, nobody expects for everyone’s response times to get seven times worse when you’ve only added some new little bit of workload, but that’s the kind of thing that routinely happens with performance. ...And not just computer performance. Banks, highways, restaurants, amusement parks, and grocery-shopping robots all work the same way.<br />
<br />
Response times are trememdously sensitive to your call counts, so <b>the secret to great performance is to keep your call counts small.</b> This principle is the basis for perhaps the best and most famous performance optimization advice ever rendered:<br />
<blockquote>
The First Rule of Program Optimization: Don’t do it.<br />
<br />
The Second Rule of Program Optimization (for experts only!): Don’t do it yet.<br />
<br />
<div style="text-align: right;">
— <a href="https://en.wikipedia.org/wiki/Michael_A._Jackson" title="Michael A. Jackson">Michael A. Jackson</a></div>
</blockquote>
<h2>
The Problem</h2>
Keeping call counts small is really, really important. This makes being a vendor of information services difficult, because it is <i>so easy</i> for application users to make call counts grow. They can do it by running more programs, by adding more users, by adding new features or reports, or by even by just the routine process of adding more data every day.<br />
<br />
Running your application with other applications on the same computer complicates the problem. What happens when all these application’ peak workloads overlap? It is a problem that <a href="https://en.wikipedia.org/wiki/Application_service_provider">Application Service Providers (ASPs)</a>, <a href="https://en.wikipedia.org/wiki/Software_as_a_service">Software as a Service (SaaS)</a> providers, and <a href="https://en.wikipedia.org/wiki/Cloud_computing#Provider">cloud computing</a> providers must solve.<br />
<h2>
The Solution</h2>
The solution is a process:<br />
<ol>
<li>Call counts are sacred. They can be difficult to forecast, so you have to measure them continually. Understand that. Hire people who understand it. Hire people who know how to measure and improve the efficiency of your application programs and the systems they reside on.</li>
<li>Give your people time to fix inefficiencies in your code. An inexpensive code fix might return many times the benefit of an expensive hardware upgrade. If you have bought your software from a software vendor, work with them to make sure they are streamlining the code they ship you.</li>
<li>Learn when to say no. Don’t add new features (especially new long-running programs like reports) that are inefficient, that make more calls than necessary. If your users are already creating as much workload as the system can handle, then start prioritizing which workload you will and won’t allow on your system during peak hours.</li>
<li>If you are an information service provider, charge your customers for the amount of work your systems do for them. The economic incentive to build and buy more efficient programs works wonders.</li>
</ol>
Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com6tag:blogger.com,1999:blog-2954359812249072053.post-63999304931060414202015-08-20T17:26:00.003-05:002015-10-01T10:47:42.709-05:00Messed-Up App of the Day: Crux CCH-01WToday’s Messed-Up App of the Day is the “Crux CCH-01W rear-view camera for select 2007-up Jeep Wrangler models.”<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-pXJWPkJsPF8/VdZEArd0TbI/AAAAAAAAB_Y/Pob6K2ti8bY/s1600/CruxCamera.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-pXJWPkJsPF8/VdZEArd0TbI/AAAAAAAAB_Y/Pob6K2ti8bY/s1600/CruxCamera.png" /></a></div>
<div class="" style="clear: both; text-align: left;">
A rear-view camera is an especially good idea in the Jeep Wrangler, because it is very difficult to see behind the vehicle. The rear seat headrests, the wiper motor housing, the spare tire, and the center brake light all conspire to obstruct much of what little view the window had given you to begin with.</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-vmrtCKIS5hM/VdZEGVJ4luI/AAAAAAAAB_8/y7Zqslifxc4/s1600/RearView.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-vmrtCKIS5hM/VdZEGVJ4luI/AAAAAAAAB_8/y7Zqslifxc4/s1600/RearView.png" /></a></div>
<div class="" style="clear: both; text-align: left;">
The view is so bad that it’s easy to, for example, accidentally demolish a mailbox.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-RqNALjlVE10/VdZEFy_n09I/AAAAAAAAB_0/c7QoBb-Uy68/s1600/Mailbox.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-RqNALjlVE10/VdZEFy_n09I/AAAAAAAAB_0/c7QoBb-Uy68/s1600/Mailbox.png" /></a></div>
<div class="" style="clear: both;">
I chose the Crux CCH-01W because it is purpose-built for our 2012 Jeep Wrangler. It snaps right into the license plate frame. I liked that. It had 4.5 out of 5.0 stars in four reviews at <a href="http://crutchfield.com/">crutchfield.com</a>, my favorite place to buy stuff like this. I liked that, too.</div>
<div class="" style="clear: both;">
<br /></div>
<div class="" style="clear: both;">
But I do not like the Crux CCH-01W. I returned it because our Jeep will be safer without this camera than with it. Here’s the story.</div>
<div class="" style="clear: both;">
<br /></div>
<div class="" style="clear: both;">
My installation process was probably pretty normal. I had never done a project like this before, so it took me longer than it should have. Crux doesn’t include any installation instructions with the camera, which is a little frustrating, but I knew that from the reviews. There is a lot of help online, and Crutchfield helped as much as I needed. After all the work of installing it, it was a huge thrill when I first shifted into Reverse and—voilà!—a picture appeared in my dashboard.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="" style="clear: both;">
However, that was where the happiness would end. When I tried to <i>use</i> the camera, I noticed right away that the red, yellow, and green grid lines that the camera superimposes upon its picture didn’t make any sense. The grid lines showed that I was going to collide with the vehicle on my left that clearly wasn’t in jeopardy (an inconvenient false negative), and they showed that I was all-clear on the right when in fact I was about to ram into my garage door facing (a dangerous false positive).<br />
<br /></div>
<div class="" style="clear: both;">
<a href="https://www.blogger.com/blogger.g?blogID=2954359812249072053" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2954359812249072053" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=2954359812249072053" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a>The problem is that the grid lines are offset about two feet to the left. Of course, this is because the camera is about two feet to the left of the vehicle’s centerline. It’s above the license plate, below the left-hand tail light.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-4eGerVjl33A/VdZEF8pqpoI/AAAAAAAACAI/BfH-vvndQSc/s1600/LicensePlate.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-4eGerVjl33A/VdZEF8pqpoI/AAAAAAAACAI/BfH-vvndQSc/s1600/LicensePlate.png" /></a></div>
<div class="" style="clear: both;">
So then, to use these grid lines, you have to shift them in your mind about two feet to the right. <i>In your mind.</i> There’s no way to adjust them on the screen. Since this camera is designed exclusively for the left-hand corner of a 2007-up Jeep Wrangler, shouldn’t the designers have adjusted the location of the grid lines to compensate?</div>
<div class="" style="clear: both;">
<br /></div>
<div class="" style="clear: both;">
So, let’s recap. The safety device I bought to <i>relieve</i> driver workload and <i>improve</i> safety will, unfortunately, <i>increase</i> driver workload and <i>degrade</i> safety.</div>
<div class="" style="clear: both;">
<br /></div>
<div class="" style="clear: both;">
That’s bad enough, but it doesn’t end there. There is a far worse problem than just the misalignment of the grid lines.</div>
<div class="" style="clear: both;">
<br /></div>
<div class="" style="clear: both;">
Here is a photo of a my little girl standing a few feet behind the Jeep, directly behind the right rear wheel:<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-0gWsRTl6oG0/VdZEFUPdnkI/AAAAAAAAB_4/xBuWoWBjBUw/s1600/GirlRear.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-0gWsRTl6oG0/VdZEFUPdnkI/AAAAAAAAB_4/xBuWoWBjBUw/s1600/GirlRear.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
And here is what the camera shows the driver while she is standing there:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-Tv19c7bCUyk/VdZEFbyeL-I/AAAAAAAAB_w/ROjNhKsYcLw/s1600/GirlCamera.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-Tv19c7bCUyk/VdZEFbyeL-I/AAAAAAAAB_w/ROjNhKsYcLw/s1600/GirlCamera.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
No way am I keeping that camera on the vehicle.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
It’s easy to understand why it happens. The camera, which has a 120° viewing angle, is located so far off the vehicle centerline that it creates a blind spot behind the right-hand corner of the vehicle and grid lines that don’t make sense.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-t2hIVvGV10o/VdZT5z3eGEI/AAAAAAAACAg/N8ggbmdrGC0/s1600/BlindSpot.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-t2hIVvGV10o/VdZT5z3eGEI/AAAAAAAACAg/N8ggbmdrGC0/s1600/BlindSpot.png" /></a></div>
<div class="separator" style="clear: both;">
The Crux CCH-01W is one of those products that seems like nobody who designed it ever actually had to use it. I think it should never have been released.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
As I was shopping for this project, my son and a local professional installer advised me to buy a camera that mounted on the vehicle centerline instead of this one. I didn’t take their advice because the reviews for the CCH-01W were good, and the price was $170 less. Fortunately, Crutchfield has a generous return policy, and the <a href="http://www.crutchfield.com/p_212BM8848/Brandmotion-9002-8848.html">center-mounting 170°-view replacement camera </a>that I’ll install this weekend has arrived today.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
I’ve learned a lot. The second installation will go much more quickly than the first.</div>
<div class="separator" style="clear: both;">
<br /></div>
Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com6tag:blogger.com,1999:blog-2954359812249072053.post-86816619913857930822015-07-29T18:26:00.001-05:002015-09-19T17:11:16.786-05:00I Wish I Sold MoreI flew home yesterday from <a href="http://carymillsap.blogspot.com/2015/07/my-friend-karen.html">Karen’s memorial service</a> in Jacksonville, on a connecting flight through Charlotte. When I landed in Charlotte, I walked with all my stuff from my JAX arrival gate (D7) to my DFW departure gate (B15). The walk was more stressful than usual because the airport was so crowded.<br />
<br />
The <i>moment</i> I set my stuff down at B15, a passenger with expensive clothes and one of those permanent grins established eye contact, pointed his finger at me, and said, “Are you in First?”<br />
<br />
Wai... Wha...?<br />
<br />
I said, “No, platinum.” My first instinct was to explain that I had a right to occupy the space in which I was standing. It bothers me that this was my first instinct.<br />
<br />
He dropped his pointing finger, and his eyes went no longer interested in me. The big grin diminished slightly.<br />
<br />
Soon another guy walked up. Same story: the I’m-your-buddy-because-I’m-pointing-my-finger-at-you thing, and then, “First Class?” This time the answer was yes. “ALRIGHT! WHAT ROW ARE YOU IN?” Row two. “AGH,” like he’d been shot in the shoulder. He holstered his pointer finger, the cheery grin became vaguely menacing, and he resumed his stalking.<br />
<br />
One guy who got the “First Class?” question just stared back. So, big-grin guy asked him again, “Are you in First Class?” No answer. Big-grin guy leaned in a little bit and looked him square in the eye. Still no answer. So he leaned back out, laughed uncomfortably, and said half under his breath, “Really?...”<br />
<br />
I pieced it together watching this big, loud guy explain to his traveling companions so everybody could hear him, he just wanted to sit in Row 1 with his wife, but he had a seat in Row 2. And of course it will be so much easier to take care of it <i>now</i> than to wait and take care of it when everybody gets on the plane.<br />
<br />
Of course.<br />
<br />
This is the kind of guy who sells things to people. He has probably sold a lot of things to a lot of people. That’s probably why he and his wife have First Class tickets.<br />
<br />
I’ll tell you, though, I had to battle against hoping he’d hit his head and fall down on the jet bridge (I battled coz it’s not nice to hope stuff like that). I would never have said something to him; I didn’t want to be Other Jackass to his Jackass. (Although people might have clapped if I had.)<br />
<br />
So there’s this surge of emotions, none of them good, going on in my brain over stupid guy in the airport. Sales reps...<br />
<br />
This is why <a href="http://method-r.com/">Method R Corporation</a> never had sales reps.<br />
<br />
But that’s like saying I’ve seen bad aircraft engines before and so now in <i>my</i> airline, I never use aircraft engines. Alrighty then. In that case, I hope you like gliders. And, hey: gliders are fine if that makes you happy. But a glider can’t get me home from Florida. Or even take off by itself.<br />
<br />
I wish I sold more <a href="http://method-r.com/software">Method R software</a>. But never at the expense of being like the guy at the airport. It seems I’d rather perish than be that guy. This raises an interesting question: is my attitude on this topic just a luxury for me that cheats my family and my employees out of the financial rewards they really deserve? Or do I need to become that guy?<br />
<br />
I think the answer is not A or B; it’s C.<br />
<br />
There are also good sales people, people who sell a lot of things to a lot of people, who are nothing like the guy at the airport. People like <a href="http://businessofsoftware.org/speaker/paul-kenny/">Paul Kenny</a> and the honorable, decent, considerate people I work with now at Accenture Enkitec Group who sell through serving others. There were good people selling software at Hotsos, too, but the circumstances of my departure in 2008 prevented me from working with them. (Yes, I do realize: my circumstances would not have prevented me from working with them if I had been more like the guy at the airport.)<br />
<br />
This need for duality—needing both the person who <i>makes</i> the creations and the person who <i>connects</i> those creations to people who will pay for them—is probably the most essential of <a href="http://www.amazon.com/gp/product/0691158304/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0691158304&linkCode=as2&tag=methodrcom-20&linkId=JLUPHRSAR73PDPUM">the founder’s dilemmas</a>. These two people usually have to be <i>two different people</i>. And both need to be Good.<br />
<br />
In both senses of the word.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com2tag:blogger.com,1999:blog-2954359812249072053.post-19914550430973056152015-07-29T12:54:00.001-05:002015-09-19T17:11:39.024-05:00My Friend Karen<a href="http://karenmorton.blogspot.com/">My friend Karen Morton</a> passed away on July 23, 2015 after a four-month battle against cancer. <a href="https://vimeo.com/117615858">You can hear her voice here</a>.<br />
<br />
I met Karen Morton in February 2002. The day I met her, I knew she was awesome. She told me the story that, as a consultant, she had been doing something that was unheard-of. She guaranteed her clients that if she couldn’t make things on their systems go at least X much faster on her very first day, then they wouldn’t have to pay. She was a Give First person, even in her business. That is <i>really</i> hard to do. After she told me this story, I asked the obvious question. She smiled <a href="https://www.enkitec.com/about/bios/karen.morton">her big smile</a> and told me that her clients had <i>always</i> paid her—<i>cheerfully</i>.<br />
<br />
It was an honor when Karen joined my company just a little while later. She was the best teammate ever, and she delighted every customer she ever met. The times I got to work with Karen were bright spots in my life, during many of the most difficult years of my career. For me, she was a continual source of knowledge, inspiration, and courage.<br />
<br />
This next part is for Karen’s family and friends outside of work. You know that she was smart, and you know she was successful. What you may not realize is <i>how</i> successful she was. Your girl was famous all over the world. She was literally one of the top experts on Earth at making computing systems run faster. She used her brilliant gift for explaining things through stories to become one of the most interesting and fun presenters in the Oracle world to go watch, and her attendance numbers proved it. Thousands of people all over the world know the name, the voice, and the face of your friend, your daughter, your sister, your spouse, your mom. <br />
<br />
Everyone loved Karen’s stories. She and I told stories and talked about stories, it seems like, all the time we were together. Stories about how Oracle works, stories about helping people, stories about her college basketball career, stories about our kids and their sports, ... <br />
<br />
My favorite stories of all—and my family’s too—were the stories about her younger brother Ted. These stories always started out with some middle-of-the-night phone call that Karen would describe in her most somber voice, with the Tennessee accent turned on full-bore: “Kar’n: This is your brother, Theodore LeROY.” Ted was Karen’s brother Teddy Lee when he wasn’t in trouble, so of course he was always Theodore LeROY in her stories. Every story Karen told was funny and kind.<br />
<br />
We all wanted to have more time with Karen than we got, but she touched and warmed the lives of literally thousands of people. Karen Morton used her half-century here on Earth with us as well as anyone I’ve ever met. She did it right.<br />
<br />
God bless you, Karen. I love you.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com7tag:blogger.com,1999:blog-2954359812249072053.post-12510157935112859822015-02-27T15:00:00.005-06:002020-10-23T13:31:18.383-05:00What happened to “when the application is fast enough to meet users’ requirements?”On January 5, I received an email called “Video” from my friend and former employee Guðmundur Jósepsson from Iceland. His friends call him Gummi (rhymes with “do me”). Gummi is the guy whose name is set in the ridiculous monospace font on page xxiv of <a href="http://amzn.to/OM0q75"><i>Optimizing Oracle Performance</i></a>, apparently because O’Reilly’s Linotype Birka font didn’t have <a href="http://en.wikipedia.org/wiki/Eth">the letter eth (ð)</a> in it. Gummi once modestly teased me that this is what he is best known for. But I digress...<br />
<br />
His email looked like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-L11rF6yVT74/VKqsPBUn7RI/AAAAAAAAB68/-C-M3nMVHz4/s1600/2015-01-05_09-21-43.png" style="clear: left; margin-bottom: 1em; margin-left: 0px; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-L11rF6yVT74/VKqsPBUn7RI/AAAAAAAAB68/-C-M3nMVHz4/s1600/2015-01-05_09-21-43.png" /></a></div>
<br />
It’s a screen shot of frame 3:12 from my November 2014 video called “<a href="http://youtu.be/AHCwwAAW3YA" target="_blank">Why you need a profiler for Oracle</a>.” At frame 3:12, I am answering the question of how you can know when you’re finished optimizing a given application function. Gummi’s question is, «Oi! What happened to “when the application is fast enough to meet users’ requirements?”»<br />
<br />
Gummi noticed (the good ones will do that) that the video says something different than the thing he had heard me say for years. It’s a fair question. Why, in the video, have I said this new thing? It was not an accident.<br />
<h2>
When are you finished optimizing?</h2>
The question in focus is, “When are you finished optimizing?” Since 2003, I have actually used <em>three</em> different answers:<br />
<blockquote class="tr_bq">
When are you are finished optimizing?<br />
<ol style="list-style-type: upper-alpha;">
<li>When the cost of call reduction and latency reduction exceeds the cost of the performance you’re getting today.<br />
<cite><span style="font-size: x-small;">Source: <a href="http://amzn.to/OM0q75" style="font-style: italic;" target="_blank">Optimizing Oracle Performance</a> (2003) pages 302–304.</span></cite></li>
<li>When the application is fast enough to meet your users’ requirements.<br />
<cite><span style="font-size: x-small;">Source: I have taught this in various courses, conferences, and consulting calls since 1999 or so.</span></cite></li>
<li>When there are no unnecessary calls, and the calls that remain run at hardware speed.<br />
<cite><span style="font-size: x-small;">Source: “<a href="http://youtu.be/AHCwwAAW3YA" target="_blank">Why you need a profiler for Oracle</a>” (2014) frames 2:51–3:20.</span></cite></li>
</ol>
</blockquote>
My motive behind answers A and B was the idea that optimizing beyond what your business needs can be wasteful. I created these answers to deter people from misdirecting time and money toward perfecting something when those resources might be better invested improving something else. This idea was important, and it still is.<br />
<br />
So, then, where did C come from? I’ll begin with a picture. The following figure allows you to plot the response time for a single application function, whatever “given function” you’re looking at. You could draw a similar figure for every application function on your system (although I wouldn’t suggest it).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-qoZVVsn-Kr4/VMqmPkM6OAI/AAAAAAAAB8s/HR-_TG2K_rg/s1600/Fig1.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-qoZVVsn-Kr4/VMqmPkM6OAI/AAAAAAAAB8s/HR-_TG2K_rg/s1600/Fig1.png" /></a></div>
<br />
Somewhere on this response time axis for your given function is the function’s actual response time. I haven’t marked that response time’s location specifically, but I know it’s in the blue zone, because at the bottom of the blue zone is the special response time <i>R<sub>T</sub></i>. This value <i>R<sub>T</sub></i> is the function’s <i>top speed</i> on the hardware you own today. Your function can’t go faster than this without upgrading something.<br />
<br />
It so happens that this top speed is the speed at which your function will run if and only if (i) it contains no unnecessary calls and (ii) the calls that remain run at hardware speed. ...Which, of course, is the idea behind this new answer C.<br />
<h2>
Where, exactly, is your “requirement”?</h2>
Answer B (“When the application is fast enough to meet your users’ requirements”) requires that you know the users’ response time requirement for your function, so, next, let’s locate that value on our response time axis.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-3atLLZsSWAY/VMqtGE5h-ZI/AAAAAAAAB9E/QjX4hqveKrs/s1600/Fig2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-3atLLZsSWAY/VMqtGE5h-ZI/AAAAAAAAB9E/QjX4hqveKrs/s1600/Fig2.png" /></a></div>
This is where the trouble begins. Most DBAs don’t know what their users’ response time requirements really are. Don’t despair, though; most users don’t either.<br />
<br />
At banks, airlines, hospitals, telcos, and nuclear plants, you need strict service level agreements, so those businesses invest into quantifying them. But realize: quantifying all your functions’ response time requirements isn’t about a bunch of users sitting in a room arguing over which subjective speed limits sound the best. It’s about knowing your technological speed limits and understanding how close to those values your business needs to pay to be. It’s an expensive process. At some companies, it’s worth the effort; at most companies, it’s just not.<br />
<br />
How about using, “well, nobody complains about it,” as all the evidence you need that a given function is meeting your users’ requirement? It’s how a lot of people do it. You might get away with doing it this way if your systems weren’t growing. But systems <em>do</em> grow. More data, more users, more application functions: these are all forms of growth, and you can probably measure every one of them happening where you’re sitting right now. All these forms of growth put you on a collision course with failing to meet your users’ response time requirements, whether you and your users know exactly what they are, or not.<br />
<br />
In any event, if you don’t know exactly what your users’ response time requirements are, then you won’t be able to use “meets your users’ requirement” as your finish line that tells you when to stop optimizing. This very practical problem is the demise of answer B for most people.<br />
<h2>
Knowing your top speed</h2>
Even if you do know exactly what your users’ requirements are, it’s not enough. You need to know something more.<br />
<br />
Imagine for a minute that you <i>do</i> know your users’ response time requirement for a given function, and let’s say that it’s this: “95% of executions of this function must complete within 5 seconds.” Now imagine that this morning when you started looking at the function, it would typically run for 10 seconds in your Oracle SQL Developer worksheet, but now after spending an hour or so with it, you have it down to where it runs pretty much every time in just 4 seconds. So, you’ve eliminated 60% of the function’s response time. That’s a pretty good day’s work, right? The question is, are you done? Or do you keep going?<br />
<br />
Here is the reason that answer C is so important. You cannot responsibly answer whether you’re done without knowing that function’s top speed. Even if you know how fast people <i>want</i> it to run, you can’t know whether you’re finished without knowing how fast it <i>can</i> run.<br />
<br />
Why? Imagine that 85% of those 4 seconds are consumed by Oracle <em>enqueue</em>, or <em>latch</em>, or <em>log file sync</em> calls, or by hundreds of <em>parse</em> calls, or 3,214 network round-trips to return 3,214 rows. If any of these things is the case, then no, you’re absolutely <i>not</i> done yet. If you were to allow some ridiculous code path like that to survive on a production system, you’d be diminishing the whole system’s effectiveness for everybody (even people who are running functions <i>other</i> than the one you’re fixing).<br />
<br />
Now, sure, if there’s something else on the system that has a higher priority than finishing the fix on this function, then you should jump to it. But you should at least leave this function on your to-do list. Your analysis of the higher priority function might even reveal that this function’s inefficiencies are <i>causing</i> the higher-priority function’s problems. Such can be the nature of inefficient code under conditions of high load.<br />
<br />
On the other hand, if your function is running in 4 seconds and (i) its profile shows no unnecessary calls, and (ii) the calls that remain are running at hardware speeds, then you’ve reached a milestone:<br />
<ol>
<li>if your code meets your users’ requirement, then you’re done;</li>
<li>otherwise, either you’ll have to reimagine how to implement the function, or you’ll have to upgrade your hardware (or both).</li>
</ol>
There’s that “users’ requirement” thing again. You see why it has to be there, right?<br />
<br />
Well, here’s what most people do. They get their functions’ response times reasonably close to their top speeds (which, with good people, isn’t usually as expensive as it sounds), and then they worry about requirements only if those requirements are so important that it’s worth a project to quantify them. A requirement is usually considered really important if it’s close to your top speed or if it’s really expensive when you violate a service level requirement.<br />
<br />
This strategy works reasonably well.<br />
<br />
It is interesting to note here that <strong>knowing a function’s top speed is actually more important than knowing your users’ requirements for that function.</strong> A lot of companies can work just fine not knowing their users’ requirements, but without knowing your top speeds, you really are in the dark. A second observation that I find particularly amusing is this: not only is your top speed more important to know, <strong>your top speed is actually easier to compute than your users’ requirement</strong> (…if you have a profiler, which was my point in the video).<br />
<br />
Better <em>and</em> easier is a good combination.<br />
<h2>
Tomorrow is important, too</h2>
<blockquote class="tr_bq">
When are you are finished optimizing?<br />
<ol style="list-style-type: upper-alpha;">
<li>When the cost of call reduction and latency reduction exceeds the cost of the performance you’re getting today.</li>
<li>When the application is fast enough to meet your users’ requirements.<br />
<cite></cite></li>
<li>When there are no unnecessary calls, and the calls that remain run at hardware speed.<br />
<cite></cite></li>
</ol>
</blockquote>
Answer A is still a pretty strong answer. Notice that it actually maps closely to answer C. Answer C’s prescription for “no unnecessary calls” yields answer A’s goal of call reduction, and answer C’s prescription for “calls that remain run at hardware speed” yields answer A’s goal of latency reduction. So, in a way, C is a more action-oriented version of A, but A goes further to combat the perfectionism trap with its emphasis on the cost of action versus the cost of inaction.<br />
<br />
One thing I’ve grown to dislike about answer A, though, is its emphasis on <em>today</em> in “…exceeds the cost of the performance you’re getting today.” After years of experience with the question of when optimization is complete, I think that answer A under-emphasizes the importance of <em>tomorrow</em>. Unplanned <em>tomorrow</em>s can quickly become ugly <em>today</em>s, and as important as <em>tomorrow</em> is to businesses and the people who run them, it’s even more important to another community: database application developers.<br />
<h2>
Subjective goals are treacherous for developers</h2>
Many developers have no way to test, <i>today</i>, the true production response time behavior of their code, which they won’t learn until <i>tomorrow</i>. ...And perhaps only until some remote, distant tomorrow.<br />
<br />
Imagine you’re a developer using 100-row tables on your desktop to test code that will access 100,000,000,000-row tables on your production server. Or maybe you’re testing your code’s performance only in isolation from other workload. Both of these are problems; they’re procedural mistakes, but they are everyday real-life for many developers. When this is how you develop, telling you that “your users’ response time requirement is <em>n</em> seconds” accidentally implies that you are finished optimizing when your query finishes in less than <em>n</em> seconds on your no-load system of 100-row test tables.<br />
<br />
If you are a developer writing high-risk code—and <i>any</i> code that will touch huge database segments in production is high-risk code—then of course you must aim for the “no unnecessary calls” part of the <em>top speed</em> target. And you must aim for the “and the calls that remain run at hardware speed” part, too, but you won’t be able to measure your progress against that goal until you have access to full data volumes <em>and</em> full user workloads.<br />
<br />
Notice that to do both of these things, <strong>you must have access to full data volumes and full user workloads in your development environment. </strong>To build high-performance applications, you must do <em>full data volume testing</em> and <em>full user workload testing</em> in each of your functional development iterations.<br />
<br />
<a href="http://carymillsap.blogspot.com/2010/10/agile-is-not-dirty-word.html">This is where agile development methods yield a huge advantage</a>: agile methods provide a project structure that encourages full performance testing for each new product function as it is developed. Contrast this with the <em>terrible</em> project planning approach of putting all your performance testing at the end of your project, when it’s too late to actually fix anything (if there’s even enough budget left over by then to do any testing at all). If you want a high-performance application with great performance diagnostics, then <a href="http://carymillsap.blogspot.com/search?q=instrumentation">performance instrumentation should be an important part of your feedback for each development iteration of each new function you create</a>.<br />
<h2>
My answer</h2>
So, when are you finished optimizing?<br />
<ol style="list-style-type: upper-alpha;">
<li>When the cost of call reduction and latency reduction exceeds the cost of the performance you’re getting today.</li>
<li>When the application is fast enough to meet your users’ requirements.</li>
<li><strong>When there are no unnecessary calls and the calls that remain run at hardware speed.</strong></li>
</ol>
There is some merit in all three answers, but as Dave Ensor taught me inside Oracle many years ago, the correct answer is C. Answer A specifically restricts your scope of concern to <em>today</em>, which is especially dangerous for developers. Answer B permits you to promote horrifically bad code, unhindered, into production, where it can hurt the performance of every function on the system. Answers A and B both presume that you know information that you probably don’t know and that you may not <em>need</em> to know. Answer C is my favorite answer because it is tells you exactly when you’re done, using units you can measure and that you <i>should</i> be measuring.<br />
<br />
Answer C is usually a tougher standard than answer A or B, and when it’s not, it is the best possible standard you can meet without upgrading or redesigning something. In light of this “tougher standard” kind of talk, it is still important to understand that what is optimal from a software engineering perspective is not always optimal from a business perspective. The term <i>optimized</i> must ultimately be judged within the constraints of what the business chooses to pay for. In the spirit of answer A, you can still make the decision not to optimize all your code to the last picosecond of its potential. How perfect you make your code should be a business decision. That decision should be informed by facts, and these facts should include knowledge of your code’s top speed.<br />
<br />
Thank you, <span style="font-family: "courier new" , "courier" , monospace;">Guðmundur Jósepsson</span>, of Iceland, for your question. Thank you for waiting patiently for several weeks while I struggled putting these thoughts into words.Cary Millsaphttp://www.blogger.com/profile/16697498718050285274noreply@blogger.com4