Hacker News new | past | comments | ask | show | jobs | submit login

CSR is expensive, because you lose customers over bad performance (measurably), and you can not scale the client. You can however scale the server.



modern JS runtimes are extremely fast on all hardware that's not a 2000-era phone or an embedded micro-controller with 4MB ram. if your CSR is slow on a modern client, then that same JS code will bring your server to its knees when you simply migrate it to an equivalent V8-powered JS backend. scaling the server will not solve this; you just have to write fast JS code and pay attention when you write it, not merely optimize as an afterthought. test on crappy hardware, test with huge datasets, test on slow connections, test with asset caching disabled, target 60fps+.

https://betterprogramming.pub/creating-a-web-performance-cul...


In theory yes, but in practice the majority of modern SPAs are slow and bloated.


Most of the slow SPAs I use are slow because they are waiting for api requests from the server.


That's one reason.

The other is that those API requests need to be rendered with JS which means downloading the JS upfront + rendering time. JS rendering will always be slower than pure HTML rendering.

I will agree for small apps this is negligible, but for bigger apps this means downloading, parsing, and executing MBs of JS. See the Google Cloud console for example or the Spotify web app.

And yet there is another point which is that with SPAs, ignorant developers can cause more "damage". The other day I opened a simple password recovery form, and it rendered dozens and dozens of divs and downloaded (I shit you not) 2MBs of JS.


No, usually its some api that's taking 1, 2, 5 or more seconds to respond. Some api written in something that's not javascript.


> that same JS code will bring your server to its knees when you simply migrate it to an equivalent V8-powered JS backend.

It's not the same because on the server you usually have some form of caching, and the V8 engine will have already JIT'd that code as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: