It helps to have performance targets. Like 60fps, sub-100ms ui reactions, no stuttering, throughput matters or not, timing attacks are a concern or not.
It's often the case that optimizing a special case 10 times increases throughput, but makes the user experience worse (because it starts stuttering), makes the code ugly, and allows for timing attacks. So, in many contexts it's actually bad idea.
Half the work in optimization is measuring the correct thing.
It's often the case that optimizing a special case 10 times increases throughput, but makes the user experience worse (because it starts stuttering), makes the code ugly, and allows for timing attacks. So, in many contexts it's actually bad idea.
Half the work in optimization is measuring the correct thing.