|
|
|
|
|
by garfieldandthe
1103 days ago
|
|
Maybe you shouldn't be doing O(n^2) inside a request handler in the first place. This has nothing to do with caches. And even if you do quadratic operations in your handler, how often do you write a new such handler? Most of the time you work on stuff around that, supporting infra, testing, etc. None of those needs to be cache optimized either. |
|
It was mostly meant as a example of millions of operations even at a small scale. Sadly I have seen way too much accidental O(n^3) code and not all of it could be "fixed" trivially.
> This has nothing to do with caches.
Would you rather handle 1000 request per second or 1? Caching has the potential to make an already bad situation so much worse.
> how often do you write a new such handler?
You only need to write one to DoS your server.