Re:“Clean” Code, Horrible Performance
by Turskarama on Tuesday February 28, 2023 @06:05PM
(#34976197)
Testing, do you not do testing? Use the software. If it seems slow drill down and find the critical path and optimize it.
[ Parent
| on HN ]
Testing is often not enough. Developers might have a few test cases with a few records, or a few other users. Real users might do more with it, and things which perform fine in testing suddenly turn into real performance bottlenecks when you're loading an order list with a thousand entries in it instead of two.
Re:“Clean” Code, Horrible Performance
by Turskarama on Tuesday February 28, 2023 @10:01PM
(#34978248)
When I said testing that includes integration testing, not just unit tests. We do this exact thing with queries that are known to be complex, run them against databases the same size and complexity as real production databases. It's not hard.
Re:“Clean” Code, Horrible Performance
by rerdavies on Tuesday February 28, 2023 @10:40PM
(#34978496)
Building representative databases is not straightforward.
If you're lucky enough to eat your own dogfood, run unit tests against a copy(!) of your in-house database. A utility to anonymize the data was a fairly significant investment, but absolutely worth it in the long run. Being able to run and monitor benchmark unit tests for selected critical operations on enterprise-scale test data as part of the continuous-build process: fabulous!