When to do optimization?

Well, that's reasonable. And doesn't contradict things which I'm talking about.

Seriously? I think you don't estimate (or maybe overestimate?) humans. I have seen way to many people who interpret this

in the following way:

  1. Write the code which is clear and simple.
  2. Show it to the others. Get approval and bonus.
  3. Deploy/release it. Switch to other project if you want more bonuses.
  4. When people complains about slowness and/or your bills for hosting grow to high — start thinking about optimization process. Usually that's problem for someone else than who did #1, #2 and #3.

Note that they perform your algorithm perfectly: till stage #4 they haven't verified that they can do a better job than the compiler. Because they never tried to optimize anything.

How can [u8; 1048576] be reject with such approach in 5 minutes — I have no idea.

When should you do that? That's the question. Way too often that step is pushed for after delpoyment/release stage. That is how we end up with JavaScript which doesn't have integers or with Windows Update which needs three weeks to update Windows and other such things.

Means when Windows Update starts taking weeks? Are sure you would be able to replace [u8; 1048576] with Rc<[u8; 1048576]> or Vec<u8> at this point?

1 Like