logoalt Hacker News

josephgyesterday at 11:23 PM1 replyview on HN

Taking a big, complex, already well optimised program like Chrome or the linux kernel and optimising the memory footprint is hard. But 90% of programs are just crappy web apps that nobody has even bothered to optimise at all. (Sometimes wrapped in electron or something.)

If you go look, you often discover that 90% of the requests are useless, or at least could be combined. That 60% of bandwidth is used up by 3 high res images which get displayed at 30x30 pixels. That CPU performance is dominated by some rubbish code that populates an array of a million items every call, then looks up 1 element then throws the whole thing away, only to regenerate the exact same list again a few microseconds later.

We have plenty of RAM. In absolute terms, 8gb of ram in the macbook neo is 8 billion bytes. 64 billion ones and zeros. You don't need rocket science to make a CRUD app that runs well with that much ram.

Computers don't get slower over time. If we were merely as lazy with computing resources as programmers 10 years ago, most programs would scream on modern hardware.


Replies

JollySharp0today at 12:13 AM

It isn't that they are crappy web devs. It is that often the org paying for the development doesn't care.

I am a web developer of over 20 years. I can create insanely optimised pages using nothing other than vanilla CSS and JS.

I have been paid exactly once to do this. There is a site I built in 2023 that has a JS and CSS footprint of less than 100KB after GZip (large site). We even had the Go templates compiled when the web app initialised so the server responded as fast as possible.

Guess what happened when it went live? The content team use 8mb images for everything and every single optimisation I did at CSS/JS was totally useless.

Devs don't care because the people above them don't care and therefore there is zero incentive to even bother.

show 1 reply