3 ms·
Surely most of the compute cycles for turning a web page into pixels happen on the client anyway? I'm not convinced the server necessarily has to do massively m
by wizofaus 4y ago
Surely most of the compute cycles for turning a web page into pixels happen on the client anyway? I'm not convinced the server necessarily has to do massively more work to return HTML over JSON (though it would obviously depend on how the HTML-generation was coded. If you're trying to use the client-style page rendering techniques on the server, issuing API calls over the network and interpreting Javascript code, then you have a point).
Edit: my "most" claim is probably too strong on reflection: while there's still a lot of work to do to convert an in-memory DOM into pixels, it's likely to be highly optimized code (some of it handled at the GPU level) that uses minimal compute cycles. And while the V8 engine may be similarly optimised, it still has to interpret and execute arbitrary JS code supplied to it, plus handle all the necessary sandboxing. It'd be interesting to get a breakdown of what compute cycles are used converting a typical SPA into pixels, and of course a comparison with how much time is spend waiting for data to come across the network.