3 ms·
From: https://www.computerenhance.com/p/clean-code-horrible-performance https://www.computerenhance.com/p/clean-code-horrible-perfor... > The speed differences
by thethirdone 4y ago
From: https://www.computerenhance.com/p/clean-code-horrible-performance https://www.computerenhance.com/p/clean-code-horrible-perfor...
> The speed differences range from 20-25x — and of course, none of the AVX-optimized code uses anything remotely like “clean” code principles.
If clean code limits your default performance to 20 times worse, those high level optimizations might not even be worth it.
- microtherion 4y agoThe point is, without a reasonably clean starting point, you'll never get to apply those 20-25x optimizations in code bases beyond a certain size, because they've become a wasteland of mediocre micro-optimizations before you even get started. So the sensible thing to do is to identify a component of manageable size, fence it off with suitable abstraction boundaries, and then apply optimizations WITHIN the confines of that component only.
- taneq 4y agoIf your performance-critical code is 25x slower than it could be, while using the same algorithm, it’s not “clean”, it’s just bad.