|
|
|
|
|
by tombert
60 days ago
|
|
I'd say it usually means "never". I also find it a bit annoying is that most people just make shit up about stuff that is "faster". Instead of measuring and/or looking at the compiled bytecode/assembly, people just repeat tribal knowledge about stuff that is "faster" with no justification. I find that this is common amongst senior-level people at BigCos especially. When I was working in .NET land, someone kept telling me that "switch statements are faster" than their equivalent "if" statements, so I wrote a very straightforward test comparing both, and used dotpeek to show that they compile to the exact same thing. The person still insisted that switch is "faster", I guess because he had a professor tell him this one time (probably with more appropriate context) and took whatever the professor said as gospel. |
|
And if you aren't optimizing for time complexity, then it's probably an over-optimization. Even if switch was faster, how much are we gaining here? A microsecond?
But, I've had instances where I've turned reports from minutes to milliseconds because of some shit SQL or doing something crazy in a loop. That's the optimization that matters, IMO.