Performance Matters: A Self Motivation of a Programmer
You are sitting before your super epic computer coding away, adding feature after feature without a worry in the world; the thrill of creation has got to you. Suddenly, from a corner of your consciousness, a voice speaks, "Oi dummy! Test the performance! What if this makes the app slower?!"
You frown. You squint at the screen thinking of what to do. Then you shrug saying, "Ah well! I'll do it at the end," and type away adding feature after feature without a worry. No! Stop!
Performance matters. Speed matters. Do it now! Do you really want to use an app that lags and stutters every time you click a button. EVEN IF it has a thousand features? Remember how you'd get frustrated each time Microsoft Office took 10 seconds to load? What about Adobe Photoshop? Firefox?
And oh how you'd jump in excitement every time an app on your super epic computer just snapped open in a blink. Oh I see you shaking your head saying, "But...but...that feature!"
Let's try something. Open your terminal/console and copy a file from your home/user directory to a folder inside a folder in your Documents.
Now do the same from your File Manager.
See the difference? How much faster it is from a terminal. Just one command and viola!
"But...but...but that's different!" I hear you say.
Performance is fundamentally about how long it takes you to perform an action, any action.
Oh but it isn't! Performance isn't only about loading speed. It's not only about rendering and latency and all that stuff. No. Performance is fundamentally about how long it takes you to perform an action, any action. An app could be super snappy but still take 5 seconds to perform an action from thought to result.
You see that is how performance is defined. How long will it take a user to go from thinking of doing an action to actually seeing the result? What if that logout button was buried ten layers deep? How about if copying a file required you to open 3 sub-menus? Do you think that's performant?
Now before you go and benchmark each and every line of your code, listen. Listen! Breathe. Yes, speed matters but if you miss your deadline it is your performance that needs to be improved. So be clever.
Because sometimes...less is more.
Ship fewer features. Write less code. Make less views. Do less navigation. Add less animations. Interrupt the user less. All those will improve both your and your product's performance. Ship faster. Build faster. That's what matters because sometimes...less is more.
It's Not Only About Code
See that person on his phone scrolling through this blog post thinking how he'll make the fastest X? How long do you imagine it'll take him to build such a thing? A couple of hours? Months? Days? Years? Weeks? Do you think he is performant?
You raise your hands in the air frustrated. "WHAT! This guy has gone crazy! Why does it matter how long it takes to build something fast?"
Let me tell you something. If it takes you a month to get that line of code to execute in under a micro-second; you lost millions of microseconds. Time is the currency in this world. If something is slow don't ship it instead of spending a month trying to make it faster because you are trading your performance for your product's. If you ship late you have less time to do more.
Don't ship slow features fast nor fast features slow.
What if you shipped that fast code in time? What if you didn't spend a month making it fast? What if you did it faster? Then it was worth it. You did it.
What About That Cool Feature?
So you skipped a feature because it was too slow what do you do now? It is an absolutely fantastic feature, something so fancy that it will blow your users' mind. I say, "Can you make it fast without hampering the release line?" No? Roll it over to the next release. No line of code is more important than your and your product's performance.
Every millisecond matters...but not more than that deadline.