4 ms·
When on a 1Mbit/s WiFi connection in Greece, my vanilla app loaded in 4 seconds and started rendering after ~2 seconds, while the React/Redux app took 50 second
by onion2k 8y ago
When on a 1Mbit/s WiFi connection in Greece, my vanilla app loaded in 4 seconds and started rendering after ~2 seconds, while the React/Redux app took 50 seconds to first render!
react + react-dom is 33.4Kb gzipped. That's not completely trivial obviously, and if your app isn't doing much DOM work it's probably unnecessary, but nor is it the reason why any app would take 50s to download on a 1Mbit/s connection. The problem was clearly something else.
I have nothing against people who choose to hate on frameworks, but if your maths is that far off it really undermines your argument.
- tenaciousDaniel 8y agoAgreed. I didn't use a framework until 2016. I use React now and love it, and yet I still find myself using all of my knowledge of the DOM when writing React, to ensure that it behaves smoothly. I personally think there are simply a higher number of devs who can code fine in React/Vue/Angular/whatever but don't fully understand the intricacies of the DOM. So the result is that these SPAs often feel slower. But it isn't the fault of the frameworks necessarily.
- tflinton 8y agoBut the reason to use a framework is to have a fast path for devs to write SPA's that feel fast without having to know the intricacies of the DOM. I'm honestly not trying to be argumentative, I really though that was the reason for using react/vue.
- tenaciousDaniel 8y agoI think that's a good argument. Although, React is much lighter on the DOM than Angular 1 was, so you could say there is improvement to some degree. But still, that's a completely fair point.
- Zelphyr 8y agoI think one problem you really highlight is that, at best, those higher number of devs who can only code in the frameworks think those frameworks are able to save them from themselves. At worst, they're lazy and don't want to take the time to learn the underlying technologies like DOM, CSS, JS, etc...
- maccio92 8y agoYeah seems suspect. Hitting pushdata.io with cache disabled downloads multiple hundreds of kb of javascript: highchart.js 75 KB boost.js 11 KB exporting.js 5 KB checkout.js 26 KB pushdata.js 57 KB !! analytics.js 17 KB and there's hundreds more KB of png images downloaded as well
- megous 8y agoI can believe the author. I have a fast internet, but I have DNS set up to resolve over DOH and over tor. This is when an idea that having everything loaded from 7 different CDNs for a page to show anything at all falls on its head. My uncached domain resolve times are in the range 1-10 seconds. So in an unhappy scenario, when things chain up, because a page needs one resource to decide that another resource from another domain needs to be loaded, and so on, I can easily wait 10-30s on a web page to load. Combine that with an idiotic FOUC prevention, that many website's designers fall for - and it means starring at a white space for the entire time, until some stupid web font loads, despite the actual text content having been already loaded for the most of the time. So if the wifi is combined with a high latency DNS, it's certainly possible. Not everything is about raw throughput.
- onion2k 8y agoI'm not disputing that website developers do stupid shit all the time. We know that's true. I'm disputing that it's got something to do with React. I've seen websites that are driven by vanilla JS that use 30MB images for backgrounds. I don't claim that's a reason to use a JS framework.
- c0nfused 8y agoI once tried to pay my electric bill in the states in china. I spent an hour trying to get the js loaded before deciding to just pay the late fee once I got home. The network may seem to be mathematically perfect but its not really.
- rlonn 8y agoNo math involved. I simply looked at the load times in the browser. As to the cause, that I don't know but it seems likely to be a lot due to inexperienced developers, like others suggested. Maybe don't focus too much on a side note? The main focus of the article wasn't performance.