6 ms·
> Users want websites to be fast and less annoying. Well, pulling some JSON via AJAX and updating a small part of the page is faster than reloading the entire
by technofire 9y ago
> Users want websites to be fast and less annoying.
Well, pulling some JSON via AJAX and updating a small part of the page is faster than reloading the entire thing.
- pwinnski 9y agoYou would think so. I mean, that's obvious, right? And yet websites are slow. That's not just "get off my lawn" crankiness, either. We're now downloading multiple megabytes, and things are rendered via javascript late in the process, so we start seeing content later than we used to, and we get the final render later than we used to. Modern websites are largely slow and annoying, a topic that has come up many, many times--with benchmarks--on HN.
- cholantesh 9y agoDoesn't that have to do with overengineering more than anything? Most of the Javascript on a modern website is pretty much superfluous I'd say.
- threatofrain 9y agoI'd also say that the JS and its burden on CPU, RAM, and battery, is also pretty trivial compared to rich media consuming more than a few MB's off a user's mobile data plan. Many people consider 1 MB to be around the upper guideline for bundle sizes; 2 MB of JS is considered quite big. But HTML CSS JS cannot compete against rich media, and how badly it drains the user's most finite resource of all -- mobile data. That's what makes an information lookup even on native Yelp costly to the user.
- threatofrain 9y agoIs JS the problem though? For really heavy apps, sure, but many people consider 1 MB to be a good upper threshold for bundle sizes. I think the biggest culprit over the web, the thing that makes me hesitant as a mobile user to visit websites willy nilly, is media content, such as images, sound, and video. Many websites look empty without media, so people splatter at least a few things on there, as do advertisements, and I think that's easily a few MB. I also think the biggest resource that people are consuming nowadays, including well-to-do people with iPhones, is not CPU, RAM, or even battery resource, but mobile data limits.
- twobyfour 9y agoBut why are we loading even 1MB to display 2K worth of text?
- threatofrain 9y agoIf people only wanted 2 kb text pages, it'd be a different story. But rich media is often what people want, so it makes even an information lookup on native Yelp expensive. Once you bring in rich media, 1 MB of JS is very minor, and JS can be used to optimize your rich media downloading.
- twobyfour 9y agoSure, but why do I need that crap on pages without rich media? And why do I need to wait for my browser (since it's on a computer other than the latest model iMac) to spend 20 seconds rendering that mess of JavaScript before I can view that content (text OR rich media), when it could display vanilla HTML faster than I can blink?
- tarboreus 9y agoI'm with you. You'll frequently see news stories with 3-5 MB of junk to augment a < 50 kB piece.That's more information than all of published human writing before 1800. Sorry, but that's stupid, and looks bad. Yes, a good chunk of that is ads, but a lot of it is loading all of two versions of bootstrap so you can use one class and similar silliness.
- richardknop 9y agoIt's actually often slower. Depending on how much functionality is written in JS and how many API calls you are making. Some single page apps out there can bring my MacBook Pro to a halt with their bloated spaghetti JavaScript and tons of AJAX calls everywhere. Rendering dynamic HTML on the server is often faster.
- porlw 9y agoThe problem is latency, which actually will get worse as bandwidth increases. 1 request pulling down 1 Mb can be quicker than 4 requests for 10Kb each.