News for hackers. Stuff that matters.
Re:Why modern software is slow by BackBlast on Friday September 30, 2022 @11:09AM (#33035930)
> Most 'performance tuning' out there is eliminating quadratic functions and putting stuff into simple dictionary caches. This should be easily teachable to any competent developer.

That does happen, but some of the more severe performance issues I've seen are memory related. Every byte allocated has to be freed. If you lower the memory profile of your function then you reduce the overhead of running the code significantly.

I recall a web service that ground to a halt and would sit at 100% CPU, after I put it in a profiler 97% of the cycles were in the garbage collector. Dig a little deeper and I found that the caching library used was cloning the data before sending it back. Ahh, junior devs.

I rewrote a library with the same interface that did not clone the data, this was safe as the original data wasn't being changed, 15x speedup from 10 req/s to 150 req/s.

Then I dug deeper and changed which data was getting cached. Cache post-render and post-compression instead of the pre-render database calls. 150x speedup from the original or 10x from the previous point. The system went from being able to serve 10 requests/s to 1500 req/s. This change also was safer since nobody is going to ever try to alter compressed data, no such guarantees from the cached database calls.

Re:Why modern software is slow by tpxl on Friday September 30, 2022 @04:25PM (#33040312)
GC has not been an issue in Java for years. I haven't seen memory issues, except for services running in ridiculously CPU or memory starved kubernetes containers.
Re:Why modern software is slow by LtdJorge on Saturday October 01, 2022 @01:05AM (#33044045)
This could be Python or another language.
Re:Why modern software is slow by tpxl on Saturday October 01, 2022 @04:16AM (#33044949)
I know, just sharing my specific experience.

A sibling poster also comments that dictionaries are too slow. They might be in a game setting, but definitely not in a Java backend service.