3 ms·
How can framework bloat (my emphasis) be faster than vanilla js? I monitor the first paint on many sites, and the more js the later the paint. None can beat a
by w-ll 2y ago
How can framework bloat (my emphasis) be faster than vanilla js?
I monitor the first paint on many sites, and the more js the later the paint. None can beat a normal site with some js niceties that trigger on dom ready.
- bigyikes 2y agoAgreed. There is no world in which React is faster than vanilla JS, except maybe certain contrived examples. Selling React as “fast” has got to be one of the greatest bamboozles of all time. I know I thought it was fast when I first started. It’s reasonably fast for what it does, but the overhead of virtual DOM diffing has real performance costs compared to vanilla. React makes it really easy to make things slow. At my job it isn’t uncommon for a single list item component to take 2ms to render on a fast machine. Multiply that by a few dozen list items, and suddenly your feature is taking hundreds of ms to rerender. Sure, you can improve things with virtual rendering and targeted optimizations, but the default case is not fast. It’s especially insane when you consider that video games can render a high fidelity 3D scene in under 16ms.
- mason_mpls 2y agoThe overhead of the virtual dom is less than modifying the actual dom unless you’re using little to no javascript. If your company’s front end that happens to have react is slow, I’m willing to bet removing react will make it even slower.
- jauntywundrkind 2y agoIt's funny how such snooty nose-in-the-air attitude about boutique hand written js masquerades as a choice any company can make. So, we can only hire artisans who hand tailor every event handler, who writes bespoke careful updates that never conflict and always handle every corner case of the dom right? And you and your 63 clones that NYT has hired will all work in harmony & concordance doing your bespoke vanillajs practices. Reacts vdom is pretty sweet. Even the old iterations of React can go eliminate a lot of paints. Old websites used to have plenty of write-read-write loops that internally block the dom, that react's lifecycle generally helps guard against. The article here talks about even further improved batch updating that React 18 can help with. Apologies my attitude, but it's just remarkably how much rancis ass attitude there is about React & how fucking stupid it sounds. I know it's the internet, that people will forever be springing up to spout off, but it's so sad having such miserable negativity hounding such perfectly respectable tech.
- w-ll 2y agoLol, you hear yourself right now. NYT site is fast, but is broke as hell. Even turning off uBlock it downloads 10mb of assets before the fold and still doesn't work. This is more salt of the earth reality, maybe you're projecting the snooty nose-in-the-air boutique'ness of React.
- mason_mpls 2y agoI’ve never had and noticeable issues using NYT and I’ve been subscribed for over a year, not sure what you’re talking about here
- jauntywundrkind 2y agoReact is as plebeian as it gets, is the mass-adopted industrial tooling. It's a rote boring and commonplace way of doing software. I generally agree that most sites are pretty bad, are way too big & usually with poor data-architectures (over fetching, re fetching, poor or no data caching). Data storage is notably something React nor very few other things have tried to tackle. GraphQL made a forray & for a while seemed ascendant but it's moment seems to be passing. The core issue of client-server model is still pretty informally handled. But even that has nothing to do with the very obvious & bad issue, that many sites are loaded with obnoxious & heavyweight & surveiling ad payloads. But it's unclear to me again what React has to do with this. (Especially as few of these as systems use React.)
- mason_mpls 2y agoAssuming you’re making a “web app” and not some simple SSR page, you will have better performance using React over Jquery or vanilla JS. The year is 2024, there are lots of websites where users expect highly interactive pages. Performance is also about way more than just first paint.
- mewpmewp2 2y agoWhat in this news website would require being a complex web app? And like they said, for complex interactive parts they are not even using React! Any other interactivity can be solved with few vanilla js snippets. You can easily do no refresh behavior with turbolinks like approach. I would understand if it was an actual web app, with tons of complex crud and other things.