4 ms·
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
by leeoniya 4y ago
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-culture-inside-your-team-f00c0d79765f?gi=c42216128096 https://betterprogramming.pub/creating-a-web-performance-cul...
- pier25 4y agoIn theory yes, but in practice the majority of modern SPAs are slow and bloated.
- postalrat 4y agoMost of the slow SPAs I use are slow because they are waiting for api requests from the server.
- pier25 4y agoThat'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.
- postalrat 4y agoNo, usually its some api that's taking 1, 2, 5 or more seconds to respond. Some api written in something that's not javascript.
- redox99 4y ago> 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.