Premature optimization
when you focus on optimization too early.
resulting in wasted effort.
often seen in programming
example - fold cards¶
when asking 2 people to fold 1000 cards and put them in an envelope, there are 2 approaches.
create a pipeline:
- 2 people fold all cards
- 2 people put them in the envelope
this pipeline appears optimized for efficiency.
but actually has some flaws.
if the card doesn’t fit in the envelop, you lost the whole batch.
a better approach would be:
2 people both go through the whole workflow: fold the card, put it in the envelope. repeat.
this pipeline might seem less efficient, but the full picture lead to faster iterations and improvements. understanding the whole process instead of focusing on “just my job”
example¶
coders often focus on optimizing code. make it run fast is good
what they don’t focus on is analytics. how often does this code run. how much time did my optimization actually save for users, instead of how much faster does it run now.
you might spent a month optimizing code that is only run once a year.
see xkcd https://xkcd.com/1205/
should you optimize it
Backlinks¶
- fix issues in my mkdocs wiki
- premature optimization causes bugs