3 ms·
What's intimidating to me is that to make a change like that, you first need to get the code, get it and the tests running, and actually understand what the cod
by Cthulhu_ 8y ago
What's intimidating to me is that to make a change like that, you first need to get the code, get it and the tests running, and actually understand what the code does - and whether your fix has the equivalent result or is subtly broken.
They didn't just change a single line in an application, they wrote a huge benchmark suite and dug through miles of code to find issues like this. I've no clue how much time they spent on it, it must've been months.
- projectramo 8y agoYou think so? Maybe but the ORM lines should be pretty insulated. If you return the same results and only speed them up you should be okay. To take an example, replacing any? with exists? doesn't seem to require testing everywhere in the project. I imagine that the average fix had lines like that. I also suspect that the fixes were pareto distributed -- that a few fixes brought most of the benefit.
- mklepaczewski 8y agoThis is not necessarily true. You would be surprised how many absolutely trivial performance issues can be found in almost every project. Sometimes it's really just about moving computation of a constant value out of a 'for' loop.
- soberhoff 8y agoI once sped up a program by 90% by turning `new String("foo")` into just `"foo"`. The project was still rotten though, so it ultimately didn't matter.
- sut-123 8y agoYour example sounds interesting, could you explain more
- soberhoff 8y agoAre you familiar with Java? If you use just `"foo"`, then the string will be interned and reused. If you use `new String("foo")`, each call creates a new copy on the heap. This call was inside a very hot loop, thus eating almost all the application's runtime.
- sut-123 8y agoThanks a lot for your explanation.