Hacker News new | ask | show | jobs
by Nyandalized 2515 days ago
Most web tasks are completely I/O bound anyway, the significance in making the few business logic decisions is minimal.
1 comments

I have seen plenty of web tasks that should be I/O bound, but were not because of inefficient coding. It's not the business logic, but the post-processing performed by devs that don't know how to write proper database queries(or designs) that costs power.

My favourite example: slurping an entire category table on each page load and then using an O(n^2) loop to rebuild the navigation tree. On a cold cache, they had request times (server-side) of 7 seconds.

Rewriting to a recursive CTE brought the page load time (client-side) down to below 100 ms, even on a cold cache.