3 ms·
I've heard lazy evaluation makes performance problems a nightmare to track down: some seemingly innocent piece of code turns out to trigger evaluation. In othe
by martincmartin 7y ago
I've heard lazy evaluation makes performance problems a nightmare to track down: some seemingly innocent piece of code turns out to trigger evaluation. In other words, the lines of code in the diff that introduces the performance regression, can be very far from the lines that do the heavy lifting, and both can be far from the line that actually needs to be changed to fix the problem.
- mokus 7y agoOne flip side of this is when undefined behavior in one library invalidates critical assumptions underlying the correctness of another, and tracking it down is a nightmare. I’d much rather, in general, get predictable and understandable semantics and have to struggle for performance than get predictable and understandable performance and struggle for semantics. Even more so, I’d rather use software that faced that profile of challenges. You can see when the program is slow at runtime, but you often can’t see when it’s wrong at runtime.