3 ms·
Performance can be orthogonal to complexity, though. Sometimes I've seen 10x gains in performance by rewriting using 90% fewer lines of code. Sometimes, I need
by trashtester 4y ago
Performance can be orthogonal to complexity, though. Sometimes I've seen 10x gains in performance by rewriting using 90% fewer lines of code.
Sometimes, I need to add a lot of extra code to gain 30% performance.
Well, I suppose it is a bi-modal distribution:
Level 1: Naive implementation of a problem, using little code. Often full of bugs or uncovered edge cases, or very slow.
Level 2: Most bugs and edge cases are covered, but the code base is enormous and still very inefficient.
Level 3: The code is successfully refactored. An elegant solution was found, that removes a lot of repetitive code, while improving quality and performance (often by a lot).
Level 4: The code is tuned to near-perfection. Most of the code is dedicated to hardcore optimizations, making it really hard to understand to a novice. Also, this level risks introducing bugs and vulnerabilities that are very hard to find.
- PaulHoule 4y agoIn web-based client-server systems one major factor for performance is the number of client-server round trips required to do a task. There is the extreme case of the app that does 3000 requests to boot up that boots up in 40 seconds over a LAN and takes 40 minutes over the WAN. From one viewpoint the code that does all the round trips might be straightforward and the process of packing up your data so the app can get it all done in one request involves more hard thinking. Something that might be just "1 more request" for the first system may involve more rethinking of the one big request in the second system. On the other hand, the second system is automatically much less error prone and you never need to think about it doing http requests when it is in a partially initialized state.