The Problem of Pre-Optimization

Ryuzaki

お前はもう死んでいる
Moderator
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
6,229
Likes
13,099
Degree
9
I saw a mention of pre-optimization in coding and it got me thinking about how that same concept plays out in all types of arenas and how it relates to other issues we all face along the way to the top.

What is Pre-optimization?​

Essentially, pre-optimization is trying to squeeze out increasingly diminishing returns from something that's not yet at a stage of completion. It's not able to perform it's function, produce revenue, or be of value for anyone yet, but we're already trying to optimize how good it will be at doing those things.

Pre-optimization Examples​

Basically, someone was asking which is a more efficient method to add some HTML to a page when you have access to Javascript and jQuery: "should I document.write() or should I .append()?" Someone else stepped in and said "Look, you're doing this operation one time, it'll take less than a fraction of a millisecond."

This person then typed a "for loop" that ran each function 1000 times each, and one took about 300 ms and one took 1000 ms or something in that range. 300 milliseconds is 1/3rd of a second and 1000 milliseconds is a second. That's to do each function 1000 times.

The guy was bogging down on crap like this instead of writing his script and getting it to a state where it's useful to him or to his users.

You know what else is pre-optimization?
  • Doing stuff like worrying about the spacing in your sidebar when you haven't even launched the site yet.
  • Wanting to get coffee mugs and ink pens printed with your logo before the business has made a dime in profit.
  • Split testing button colors for clicks before a single conversion has come in.
  • Trying to rank in SERPs against DR80 sites when your own site is DR15.
  • "I'll publish 600 posts locally and THEN I'll launch the site and then maybe think about links."
We've all probably done it at some point. In some ways it logically makes sense to finish up some aspect of a project so you can move on and never think about it again. But if you aren't already proficient and can't get that done incredibly fast, you're pre-optimizing and wasting time.

Why do we fall for the pre-optimization trap?​

It's definitely an anxiety-related issue, I'd say, and one that's caused by the coping mechanisms we've developed to keep the anxiety at bay.

All-or-None Thinking

"If I can't get it working the best it can now, I won't be able to later, so what's the point of moving on? I get it right now or I might as well give up."

Perfectionism

"I have to optimize it now because it might become spaghetti code later and I won't be able to fix it, plus it needs to be as optimized as possible at launch in case those few extra CPU cycles matter."

Procrastination

Subconsciously: "I need to get this done now before I do the harder part, because I'm chipping away at the surrounding factors and that'll make the harder part easier, or at least less confusing. Let me just do this for now."

Fear of Success

Success comes with a lot of responsibility and a lot of unknowns. There are people that will sabotage every aspect of their lives to make sure they don't succeed. "The present is comfortable and complacency is less challenging than winning."

How to defeat the pre-optimization goblin?​

I didn't know how to wrap up this post because I hadn't thought it out this far (because I didn't pre-optimize it!)... I think the first step is to notice that you're doing this. You may not notice until you're in the weeds, but at any point you can pull yourself back out.

In time you can figure out which trick of the mind above is causing you to pre-optimize things that don't need it. Then you can not only look out for the act of pre-optimizing but the thoughts that lead to it. You come to know yourself more deeply and be a little more aware of your own cognitions.

And ultimately, you have to refute those thoughts, explain to yourself why they're stupid and the opposite is better, and also feel the emotions that are leading to the thoughts rather than flee from them by pre-optimizing and coping with the thought patterns above.

Part of squashing the acts and thoughts permanently is repetition. The other part is understanding why NOT pre-optimizing is better, and agreeing with it whole-heartedly. And the reason why moving on is better until the product/project is complete is because we have limited time (at the moment, during the day, till the deadline, on this earth) and we need to be racing to ROI (return on investment).

That return may be money in exchange for your time or growing expenses. It may be offloading work to workers or bots. It may be simply making sure you meet a deadline and don't get fired.

Whatever it is, a 50% done / 100% optimized "thing" is worth nothing to anyone. A 100% done / 25% optimized thing has the potential to generate millions of dollars.

Optimizing after completion is not only easier, but it's sensible, too. That's because you need to validate whatever it is you're doing and you can get that done with a minimum viable product (and in some cases even the promise of one, but that's beside the point). Get anything to the finish line and find out if it serves the purpose it was intended to and/or if people want it. If it does and they do, then you can optimize. Holding back and releasing improvements offers a lot of marketing value too.

And that's Ryuzaki's Coffee & Shower Thoughts from this morning. Stay tuned for the next episode.
 
I to have been reading this forum and thinking these things. The lab section progressions really illustrate some of these points well.

Wish I was as good at expressing them to people in constructive ways as you are.
 
Last edited:
Back