←back to thread

3883 points kuroguro | 3 comments | | HN request time: 0.637s | source
Show context
luckystarr ◴[] No.26296728[source]
Well, that's embarrassing. I can't even imagine the level of shame I would feel if I had written the offending code.

But, you know, premature optimization yadda yadda.

replies(5): >>26296911 #>>26298188 #>>26301348 #>>26302026 #>>26308204 #
1. rcxdude ◴[] No.26301348[source]
It's the kind of thing that's very easy to accidentally write, it's not that shameful. What's shameful is not investigating the load times at all, since the problem is so easy to see when any measurement is done.
replies(1): >>26304752 #
2. luckystarr ◴[] No.26304752[source]
If 63k entries with 10MB of actual data takes minutes to process on a current computer I'd consider that shameful.

10MB is less than the cache in modern CPUs. How can this take minutes(!).

replies(1): >>26310048 #
3. rcxdude ◴[] No.26310048[source]
It's easy to write because it doesn't run noticably slowly on smaller data, and it's easy to accidently introduce quadratic behaviour in some systems. Obviously if someone tested this on 10MB of JSON and saw it took minutes and thought that was reasonable, that's a bit ridiculous, but I doubt at the time the code was written anyone expected it to be fed such a large JSON object.