« All Episodes

Part 2: Performance Budget for Optimization

Published 4/27/2016

In today's episode (and the next episode of Developer Tea), we discuss avoiding over-optimization by creating a "performance budget".

Mentioned or relevant to today's episode


Today's episode is sponsored by FreshBooks! Get paid faster, and get control of your business cash flow. Head over to FreshBooks.com/DeveloperTea today to get started with a free month. Don't forget to enter “Developer Tea” in the “how Did you Hear About Us?” Section when you sign up. Thanks again to FreshBooks for sponsoring the show!

Transcript (Generated by OpenAI Whisper)

Hey everyone and welcome to Developer Tea. My name is Jonathan Cottrell and in today's episode, we continue our discussion on over optimization and creating a performance budget. If you missed the last episode of Developer Tea, I recommend you go and listen to it before you listen to today's episode, partially because we pick up in the middle of a list of five things that you need to consider when you're creating a performance budget, but also because we talk a little bit about over optimization and why you don't want to over optimize and how that can occur. Today's episode is sponsored by FreshBooks. FreshBooks is the ridiculously easy to use online accounting software designed to help creative entrepreneurs get organized, save time and get paid faster. We will talk about how all of that works later on in the show. So we left off in the middle of the show. We're in the middle of the list of five things that you need to be thinking about when you create your performance budget. And before we dive into the last two, I want to make sure that I remind you of the first three. Number one was determine the usage rate over time of the piece of code that you're considering optimizing. Determine the usage rate over time. And number two, determine the lifetime of that particular piece of code. And when you combine these two things, you can determine the amount of value that you potentially add by performing that optimization. Finally, number three, what are the minimum optimizations necessary? What are the minimum requirements, the minimum optimizations necessary? It may be readability of text. It may be running time. It could be anything. But you have to determine that minimum optimization necessary. This will end up reading directly into your performance budget. And you should treat these like in a financial. Budget, you would treat bills. You can't invest in something without paying your bills first. And an optimization is an investment. You want a long term return on that investment. And this is why we use that metaphor of a budget. If you think about your minimum optimizations as absolutely necessary before you go and do any other optimizations, then the priority of a particular optimization becomes a little bit more important. So that is why we need to determine those minimum optimizations. OK, so number four for today, what are the useful performance limits? What are the useful performance limits? What we mean by useful limits or useful performance limits here is the minimum metrics or optimizations that actually matter to the end user. For example, optimizing more than about 100 frames per second in any given app that a user is using. If you're looking at a user's looking at optimizing that interface to be faster than 100 frames per second is arguably not really necessary as we don't really notice the difference as humans. Our eyes can't really notice the difference beyond 100 frames per second. And again, that's a little bit debated, but there is a number of frames per second that if you go past that, it's not really adding any extra benefit for us. So that would be that useful performance limit. However, for your particular project. you may also determine that optimizing for a frame rate any greater than 30 frames per second isn't necessary. For example, if you have a static UI that doesn't really move around, that's not really scrollable, you may not need much more than 30 frames per second. And so it totally depends on your project what those useful performance limits are. Think about the way you will determine these useful minimums. Take some time and think about it. Don't take the blanket advice of any particular number that you find on a Google search. Think about the users for your particular application. A human doesn't notice the difference of five milliseconds of optimization of an action they take 10 or 20 times or even 100 times. But a computer running an algorithm a million times a day will certainly notice the difference of five milliseconds. In fact, five milliseconds difference on a million operations times that five milliseconds. Five milliseconds is just over 83 minutes of time. So in one scenario, five milliseconds may be negligible. But in the other scenario, optimizing for five milliseconds may mean significant computing resources. The useful performance limits of high use algorithms then are going to be significantly more vigorous than the limits on a human performed action. So that's one thing that you may take into account when you determine your useful performance. Performance limits. So again, number four, what are the useful performance limits of that particular piece of code? And finally, number five, investment for optimization required. Determine the investment for that particular optimization. How much time and energy will it take to accomplish a particular optimization to its minimum optimization level? You remember step three, we determined the minimum optimization. This is why. We need to determine the minimum optimization. We need to determine how much time and energy it takes to reach to that minimum optimization. Be certain to consider if you can accomplish 50% of that optimization in one day, and the next 50% takes two weeks. This shows you that as the optimization level increases, the amount of investment needed to optimize further increases exponentially. And this is similar to the 80-20 rule. If you have heard of the 80-20 rule, the idea that 80% of the business is going to be optimized for the next two weeks, comes from 20% of the work. So you want to determine that investment necessary for that minimum optimization, but also the investment necessary for that useful performance limit, that maximum useful optimization. We're going to take a quick sponsor break, and then we're going to talk about how you can use these five things to actually create your performance budget. Today's episode is sponsored by FreshBooks. Using FreshBooks to create and send an invoice literally takes about 30 seconds. There's no formulas or formatting, just perfectly crafted invoices every single time. And your clients can pay you online, which means that you end up getting paid a lot faster. If a client forgets to pay you on time, FreshBooks handles that awkward conversation of reminding them about their late payments. FreshBooks also makes expense tracking very easy. They have a mobile app that lets you take pictures of your receipts, and FreshBooks automatically organizes them for later. They also have automation. You can automatically import expenses directly from your bank account. So next time you use your debit card for that business lunch, watch the transaction magically appear in your FreshBooks account. You can also track time with FreshBooks. They have cash flow tracking. You can know what you did and when you did it, and the little details about your cash flow are kept in one place. So FreshBooks knows exactly what invoices you sent, when you sent them, and who's paid you. And perhaps most importantly, who owes you what. FreshBooks is offering a free month to DeveloperT listeners. To claim that free month, go to freshbooks.com slash developer T and enter developer T in the how did you hear about us section when you sign up. Thanks again to FreshBooks. That link will be in the show notes at spec.fm. So today's episode is part two of talking about over-optimization and fixing that with a performance budget. And we're talking about five things you need to think about when you're in the business. So let's get started. So let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started. Let's get started.