News for hackers. Stuff that matters.
Re:In spite of an increase in Internet speed, webpage speeds... by partiallypro on Tuesday August 04, 2020 @04:45PM (#24054310)
The main culprit, imo is javascript. People/clients want more and more complex things, but javascript and its libraries are the main culprit. Image compression, minification...it helps, but if the page needs a lot of JS, it's going to be slower.

Slightly off topic, but I have a site that fully loads in ~2 seconds but Google's new "Page Speed Insights" (which is tied to webmaster tools now) give it a lower score than a page that takes literally 45 seconds to fully load. Please someone at Google explain this to me. At least GTMetrix/Pingdom actually makes sense.

Re:In spite of an increase in Internet speed, webpage speeds... by bearjaws on Tuesday August 04, 2020 @05:13PM (#24054556)
Users expect load times proportional to the content expected, if I am loading photoshop I don't expect it to be quick.

However if I am loading Reddit, I expect it to be fast, and it seems the websites that should load the fastest are now loading the most 'non-essential' JS, leading to worse performance than peoples expectations.

In my experience JS adds at most hundreds of miliseconds, and thats because people add dozens of marketing/tracking code that bog the site down.

If you run ghostery / ublock the javascript eval time shrinks dramatically. Our web app has a very large Angular app and it still renders in under 200ms, but we don't have any "plugins" due to working with PHI.

Re:In spite of an increase in Internet speed, webpage speeds... by reaperducer on Tuesday August 04, 2020 @06:08PM (#24055008)
Users expect load times proportional to the content expected

And how do you think that happened? It's not a chicken-and-egg problem. Web pages got fat, and users' expectations got lower. Lazy devs have trained people to expect the worst, not the best. The app ecosystem wouldn't be half the size it is if web pages worked as fast as native apps.

If you run ghostery / ublock the javascript eval time shrinks dramatically.

Are you going to be the one to explain to the marketing department why you put instructions for doing so at the top of each of your company's web pages?

Re:In spite of an increase in Internet speed, webpage speeds... by neurostimulant on Tuesday August 04, 2020 @05:22PM (#24054639)
Page Speed Insight mainly measure how fast your above-the-fold content loads. It doesn't matter if your page loads a bunch of heavy js and images as long as it's deferred/lazy-loaded and doesn't block initial render. For example, amp pages actually load a lot of js for its component, but it doesn't block above-the-fold render and thus scored really great on page speed insight. Personally, I think page speed insight is one of google's strategy to encourage people to use AMP more.

Edit: Also, I find it comical that when you include recaptcha v3 on your website, your page speed insight score can drop almost 20 points. It is as if google don't want you to use recaptcha at all.

Re:In spite of an increase in Internet speed, webpage speeds... by sli on Tuesday August 04, 2020 @05:48PM (#24054838)
> but it doesn't block above-the-fold render and thus scored really great on page speed insight

Which is ridiculous and just builds in the ability to game the system, because in my experience, amp pages take upwards of 5-8 seconds before anything of use to me actually loads, while the non-amp version loads in a fraction of that time.

I imagine someone is benefiting from amp, otherwise it wouldn't be used, but I have not experienced a single case where the amp version of a site wasn't significantly slower.

Re:In spite of an increase in Internet speed, webpage speeds... by neurostimulant on Tuesday August 04, 2020 @05:51PM (#24054869)
I think a while ago you could get perfect 100 score on page speed insight by putting all your content inside an iframe :)
Re:In spite of an increase in Internet speed, webpage speeds... by tester756 on Tuesday August 04, 2020 @06:43PM (#24055300)
Last time I tried WebAssembly website that's loading 4-5 MB of data and it managed to score something like >95 meanwhile page was ready after like 5-10sec.
Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Tuesday August 04, 2020 @05:35PM (#24054745)
More specifically the culprit is generally unnecessary string parsing. Every CSS selector, such as querySelectors and jQuery operations, requires parsing a string. Doing away with that nonsense and learning the DOM API could make a JavaScript application anywhere from 1200x-10000x faster (not an exaggeration).

Most JavaScript developers will give up a lung before giving up accessing the page via selector strings. Suggestions to the effect are generally taken as personal injuries and immediately met with dire hostility.

Re:In spite of an increase in Internet speed, webpage speeds... by chubot on Tuesday August 04, 2020 @06:06PM (#24054989)
[citation needed] There are a lot of other reasons why client side JS is slow, including page reflows, bad use of the network, etc. I'm not a front end dev but I have fixed many performance problems before, and I've never seen parsing CSS selectors as a bottleneck.

I've seen some data driven work like this: https://v8.dev/blog/cost-of-javascript-2019

I don't think they mentioned parsing CSS selectors anywhere. Shipping too much code is a problem, because megabytes of JS is expensive to parse, but IIUC that is distinct from your claim.

Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Tuesday August 04, 2020 @06:13PM (#24055056)
> I'm not a front end dev

But I am.

You are correct in that there many other opportunities to further increase performance. If performance were that important you would also shift your attention to equally improve code execution elsewhere in your application stack.

> and I've never seen parsing CSS selectors as a bottleneck.

It doesn’t matter what our opinions are or what we have/haven’t seen. The only thing that matters are what the performance measurements say in numbers.

EDIT

To everybody asking for numbers I recommend conducting comparative benchmarks using a perf tool. Here is a good one:

http://jsbench.github.io/

I posted a performance example to HN before and people twisted themselves into knots to ignore numbers they could easily validate and reproduce themselves.

Re:In spite of an increase in Internet speed, webpage speeds... by esperent on Tuesday August 04, 2020 @10:46PM (#24056791)
> > I'm not a front end dev

> But I am.

So am I, and I disagree with you.

Here's an actual benchmark that you can run[1] (why did you not share an actual benchmark?). I get, on my old and slow Android, 500k ops/sec for querySelector.

At 60fps, that allows you to do ~8000 selections per frame, assuming you're not doing anything else. In reality, any app I've ever encountered probably has a few hundred querySelector calls, in total, and if the app is well written, the majority of these are cached meaning they only get called once, not once per frame.

[1] https://www.measurethat.net/Benchmarks/Show/2488/0/getelemen...

Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Tuesday August 04, 2020 @11:26PM (#24056996)
500k ops is ridiculously slow for accessing the DOM on any modern hardware. It sounds fast when aren’t comparing it to anything. Compare that to a similar approach that makes use of the standard DOM methods and no selectors. The only thing querySelectors do faster is allow accessing elements by attribute.

The reason I refuse to post numbers myself is because:

1. I provided a tool where people can run any manner of discovery for their own numbers and see performance differences in various approaches.

2. People, when presented with a valid comparison will irrationally ignore results that challenge their opinion.

EDIT:

I looked closer at the measureit experiments and it seems there is some sort of bias. If you run the same experiment using an element already present in the page the results are the same for querySelector but 50% greater for the getElementById approach. Other perf tools I have tried did not display this kind of bias and they also reported substantially higher numbers for all user agents, most especially for desktop Firefox.

Re:In spite of an increase in Internet speed, webpage speeds... by daerogami on Tuesday August 04, 2020 @11:42PM (#24057068)
In response to 1, you're asking people to do their own research when you have stated the claim. The burden is on you.

As for 2, if it's such a problem, just don't make the argument. It genuinely comes off as wanting people to agree with you rather than any real interest towards engaging in actual discussion.

Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Wednesday August 05, 2020 @12:41AM (#24057296)
> The burden is on you.

Then just disagree with me.

Re:In spite of an increase in Internet speed, webpage speeds... by esperent on Wednesday August 05, 2020 @03:04AM (#24058036)
> 500k ops is ridiculously slow for accessing the DOM on any modern hardware. It sounds fast when aren’t comparing it to anything.

I didn't say it was fast OR slow. I just said it's not slow enough to be the problem that you're claiming it is.

If you disagree with this, could you provide evidence of a situation where accessing elements with strings is a bottleneck? As I said, I've never seen this in practice and if it can be the case I would like to know more.

> Compare that to a similar approach that makes use of the standard DOM methods

querySelector is a standard DOM method.

> and no selectors

I don't know what you're referring to here. Could you provide an example?

Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Wednesday August 05, 2020 @06:36AM (#24059194)
Re:In spite of an increase in Internet speed, webpage speeds... by esperent on Wednesday August 05, 2020 @11:39PM (#24067931)
I've seen so many benchmarks for these selectors I basically know them by heart. I'm asking for a real world example where selectors cause slowdown.
Re:In spite of an increase in Internet speed, webpage speeds... by foota on Wednesday August 05, 2020 @01:06AM (#24057438)
It doesn't matter if they're slower than the alternative, it matters how they affect the overall performance of the app.
Re:In spite of an increase in Internet speed, webpage speeds... by bscphil on Tuesday August 04, 2020 @06:27PM (#24055182)
It's funny, you say

> It doesn’t matter what our opinions are or what we have/haven’t seen. The only thing that matters are what the performance measurements say in numbers.

But your only argument here is not numbers, but appeal to authority:

> > I'm not a front end dev

> But I am.

I don't have any particular reason to doubt you, but if objective numbers should rule the day here, maybe you could link to an article comparing the performance of a simple application using CSS selectors and then switching to using the DOM API?

Re:In spite of an increase in Internet speed, webpage speeds... by pas on Tuesday August 04, 2020 @06:28PM (#24055186)
Could you provide said numbers? Maybe you have seen a lot of pathological cases, but that might not be representative.
Re:In spite of an increase in Internet speed, webpage speeds... by filleduchaos on Wednesday August 05, 2020 @12:03AM (#24057157)
I'm not the poster in question, but I thought it was pretty well known that querySelector[All] with a class string is shockingly slow - I'm actually a bit confused that everyone here is acting like they said something out of the ordinary. If that's really not common knowledge, it's probably no surprise that people are unintentionally writing websites that run like absolute crap on mobile devices.

Here's a JSPerf (not mine) that you can run and see yourself just how bad the performance is: https://jsperf.com/getelementbyid-vs-queryselector/284. getElementsByClassName runs nearly five million operations per second on my laptop (8th-gen i7, 16GB of RAM, latest Chrome); querySelector[All] with a class name runs less than ten thousand. And the sample HTML is tiny indeed compared to a typical web site or app.

Re:In spite of an increase in Internet speed, webpage speeds... by chubot on Wednesday August 05, 2020 @01:11AM (#24057466)
I think what you're referring to is that querySelector is O(n), while the older getElement APIs are O(1).

https://stackoverflow.com/questions/14377590/queryselector-a...

That makes sense, but it has nothing to do with "string parsing", as the OP said. Parsing the query is fast. Executing the query is slow, because it's a more general API.

(And this is why the citation is important: because it shows the real issue, not the one described! Thanks for the clarification.)

Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Wednesday August 05, 2020 @04:34AM (#24058522)
Re:In spite of an increase in Internet speed, webpage speeds... by cuddlecake on Tuesday August 04, 2020 @06:39PM (#24055275)
But still, please follow up on [citation needed] please
Re:In spite of an increase in Internet speed, webpage speeds... by UberMouse on Tuesday August 04, 2020 @06:29PM (#24055191)
Then provide some numbers?
Re:In spite of an increase in Internet speed, webpage speeds... by filleduchaos on Wednesday August 05, 2020 @12:04AM (#24057163)
Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Wednesday August 05, 2020 @04:17AM (#24058409)
I love how big the numbers are in recent versions of Firefox. On my crappy work computer that can barely run Notepad++ I am pulling 1.8 billion ops for getElementById and getElementsByClassName. The performance gaps:

* getElementById vs equivalent querySelector is about 1000x.

* getElementsByClassName vs querySelectorAll is about 250,000x.

* On Chrome getElementsByClassName vs querySelectorAll is only about 426x.

This is a micro-benchmark. In the real world that disparity would magnify almost exponentially with the number of nodes in a given page and the frequency and depth of access requests to the DOM.

Re:In spite of an increase in Internet speed, webpage speeds... by UberMouse on Thursday August 06, 2020 @12:08AM (#24068038)
I decided to check back in this and this seems like it was entirely a wording problem in your first post. Your post implied that _parsing the query selector string_ was slowing down Javascript websites, which obviously made everyone do a hottake and jump in to say that can't be the case. What you seem to _actually_ be saying is that using query selectors instead of finding elements directly by class/id is slow which yes, that's certainly the case.
Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Thursday August 06, 2020 @06:29AM (#24069670)
Query selectors are slow, yes, but its because they have to parse a string. Other DOM methods don't have a string parsing step. You cannot optimize access to the DOM if there is a string parsing step that must occur first.

That barrier to efficiency is greatly magnified by the complexity of the query string, the size of the dynamically rendered page, and the number of query strings. If not for that string parsing step why would query selectors be any different from any other DOM access instruction computationally?

Re:In spite of an increase in Internet speed, webpage speeds... by filleduchaos on Thursday August 06, 2020 @02:46PM (#24074126)
You're quite frankly leaping to conclusions quite a bit, as well as starting from the (rather flawed) premise that parsing a, what, ten-character string is so slow that it can slow an operation down by three orders of magnitude.

There are any number of reasons why the querySelector API would be computationally different from the getElementX ones, especially considering that they don't even return the same thing.

Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Thursday August 06, 2020 @09:03PM (#24076982)
They return exactly the same thing: either null or a node or node list depending upon the method in question.

Any number of reasons like what? Could you provide an example of what would make those methods that much slower?

Re:In spite of an increase in Internet speed, webpage speeds... by filleduchaos on Thursday August 06, 2020 @09:42PM (#24077180)
> They return exactly the same thing: either null or a node or node list depending upon the method in question

...this is another thing that I'm surprised to find that people don't know. Do devs really just use these methods without ever looking at what they return or how they behave?

getElementsByClassName returns a (live) HTMLCollection, not a NodeList. querySelectorAll returns a (static) NodeList. That in itself is an obvious computational difference/potential bottleneck, because the simplest way to implement a live collection is to cache and return the same object on subsequent calls for it. And that's precisely what browsers do (getElementsByClassName('foo') === getElementsByClassName('foo')). In other words, getElementsByClassName called multiple times with the same class doesn't actually do any extra work. The real work for the browser engine, which doesn't actually happen at the point of function call, is watching any tracked class names and updating their associated HTMLCollections when an element matching that class name is added or removed from the DOM.

On the other hand, gathering the static NodeList for a querySelectorAll call requires actually iterating over the DOM to find element(s) matching the selector every time (in the naive implementation), with the trade-off of the engine not having to watch the collection internally.

As an aside, the querySelector method with an ID selector is slower but on the same order of magnitude (a difference of about a few hundred thousand ops/sec for me) as the getElementById method. So if one looks at all the data in the benchmark and not just the class ones in isolation, it becomes clear that merely parsing the selector string is not enough to drop millions/billions of operations per second down to single-digit thousands.

Re:In spite of an increase in Internet speed, webpage speeds... by fermienrico on Tuesday August 04, 2020 @06:10PM (#24055031)
At this point, we need to reimagine what a web browser is and how it should be.

It cannot happen since we want backwards compatibility.

Re:In spite of an increase in Internet speed, webpage speeds... by rozenmd on Tuesday August 04, 2020 @05:02PM (#24054457)
From what I've seen building PerfBeacon.com, it seems more like images in e-commerce sites are the worst offenders.

Slowest site I've tested so far had a page size of 8.5MB, 80% of that was images.

Re:In spite of an increase in Internet speed, webpage speeds... by doteka on Tuesday August 04, 2020 @05:49PM (#24054849)
Hah, if only it was images. At work, our b2b app loads about 5MB of minified and compressed JavaScript and I don’t even know anymore.
Re:In spite of an increase in Internet speed, webpage speeds... by Escapado on Tuesday August 04, 2020 @06:16PM (#24055080)
At my current gig we do that too for a dead simple frontend. a couple of simple tables and cards, a navigation and a footer and we're easily over 2mb. But as I have been told that's what happens when Google analytics gets pulled in and all the code needs to adhere to enterprise style DDD (in a react app mind you). Apparently 400 layers of indirection and encapsulation are the way to go...

edit: Just looked it up. header has a logo and 5 links. footer has a scroll to top button and 10 links. both responsive. How many lines of code you ask? A little over 3400.

Re:In spite of an increase in Internet speed, webpage speeds... by rozenmd on Tuesday August 04, 2020 @06:15PM (#24055072)
Ouch, does the app use code splitting at least?
Re:In spite of an increase in Internet speed, webpage speeds... by anonymoushn on Wednesday August 05, 2020 @03:51AM (#24058271)
Atlassian products seem to use a really great code-splitting-like tech: 4MB js bundles are dynamically generated from a list of which modules should be included in the bundle which is dynamically generated by some other js on the page. So you're essentially guaranteed to get the same modules into your cache a dozen times in slightly different 4MB js bundles.
Re:In spite of an increase in Internet speed, webpage speeds... by rozenmd on Wednesday August 05, 2020 @04:08AM (#24058369)
Re:In spite of an increase in Internet speed, webpage speeds... by anonymoushn on Wednesday August 05, 2020 @05:49AM (#24058928)
I'm not sure what the tech is called other than the reason I spend multiple hours a week waiting for jira and confluence to load pages with like 300 words on them
Re:In spite of an increase in Internet speed, webpage speeds... by heisenbit on Tuesday August 04, 2020 @06:27PM (#24055177)
Angular, React, Vue, etc. are all getting better reducing the bloat. Javascript packaging and tree shaking is also much better. A lot of old compatibility stuff for IE etc. also can be dumped now. JS compilation got faster. The reason we are not seeing any speedup is the code that is not needed: Tracking and advertisements - this stuff seems to fill any size and speed gains.
Re:In spite of an increase in Internet speed, webpage speeds... by s1t5 on Tuesday August 04, 2020 @05:10PM (#24054530)
I'm not a web developer so I really have no idea about this - is WebAssembly a viable solution or have I just absorbed some hype without understanding the problems with JS?
Re:In spite of an increase in Internet speed, webpage speeds... by flohofwoe on Tuesday August 04, 2020 @05:17PM (#24054582)
WebAssembly on its own won't help with web page bloat. As with all things on web pages, it can both be used to add more bloat, or to reduce bloat. Web page bloat isn't mainly a technical problem and can't be solved by technology alone.
Re:In spite of an increase in Internet speed, webpage speeds... by austincheney on Tuesday August 04, 2020 @05:55PM (#24054901)
No. Webassembly is not faster than JavaScript enough to account for the features and APIs browsers supply with JavaScript. That being said WebAssembly is a superior alternative to JavaScript only when not recreating the interactions already available with JavaScript. Where WebAssembly shines are things like large binary media, games, and avoiding things like garbage collection.
Re:In spite of an increase in Internet speed, webpage speeds... by jefftk on Tuesday August 04, 2020 @04:51PM (#24054369)
If you post the links for the two sites I would enjoy looking at them to figure out why PSI is giving such strange scores
Re:In spite of an increase in Internet speed, webpage speeds... by xchip on Tuesday August 04, 2020 @05:53PM (#24054894)
The question is, why does your site needs so much javascript? Most prob is for tracking :/
Re:In spite of an increase in Internet speed, webpage speeds... by partiallypro on Tuesday August 04, 2020 @06:10PM (#24055020)
The great irony for Google is that their own tracking pixels for Analytics, GTM, AdWords, Adsense are some of the biggest culprits for pages hanging on loads.
Re:In spite of an increase in Internet speed, webpage speeds... by XCSme on Tuesday August 04, 2020 @06:17PM (#24055088)
That's because you are not using AMP. /s
Re:In spite of an increase in Internet speed, webpage speeds... by dgb23 on Tuesday August 04, 2020 @05:01PM (#24054444)
That statement seems to general.

JS in of itself is not a performance issue in many cases. It can even improve performance in terms of speed/responsiveness.

Re:In spite of an increase in Internet speed, webpage speeds... by grishka on Tuesday August 04, 2020 @05:27PM (#24054680)
People misuse and abuse JS all the dang time. Take Twitter: you follow a link to a tweet from somewhere else, but first thing you see as the page loads is not the tweet — it's everything but the tweet itself. There's a spinner instead of it, because rendering it server-side would've made too much sense, I guess. Gotta make an API request from the client and render it client-side just because that's so trendy.

In other words, there are too many websites that are made as "web apps" that should not be web apps.

Re:In spite of an increase in Internet speed, webpage speeds... by bananaface on Tuesday August 04, 2020 @05:53PM (#24054891)
Which is made way worse by the fact that tweets are 280 characters of text. It's absurd that Twitter has a higher delay than a few round trips when they aren't reloading any structural content. Wtf are these people on 300k salaries doing all day?
Re:In spite of an increase in Internet speed, webpage speeds... by grishka on Tuesday August 04, 2020 @06:17PM (#24055090)
This strict character limit is a defining feature of microblogging, and it has nothing to do with engineering.
Re:In spite of an increase in Internet speed, webpage speeds... by ezconnect on Tuesday August 04, 2020 @06:32PM (#24055214)
His point is it's just 280 characters of text to download to the client to show the tweet. The client have downloaded probably 1,000x that much text before he can even see what he wants to see.
Re:In spite of an increase in Internet speed, webpage speeds... by munk-a on Tuesday August 04, 2020 @07:20PM (#24055560)
Ah - but here you're hitting a wall. You could build a very lean twitter with minimal advertising and a more sane tweet presentation order - but nobody on the business side of things actually wants you to build that. They want you to build a social media platform that can be leveraged with synergies and RoI to maximize user retention and hopefully get a bit of Ad money out of the process somewhere along the way.
Re:In spite of an increase in Internet speed, webpage speeds... by grishka on Tuesday August 04, 2020 @09:57PM (#24056540)
Looking at the current sorry state of most of the IT industry, I can't help but feel like the business side of things is the problem.
Re:In spite of an increase in Internet speed, webpage speeds... by munk-a on Wednesday August 05, 2020 @12:35PM (#24062707)
It is. And I think this is because customers aren't valued they're commoditized, now personal information is a commodity with a fair bit of value and society has failed to properly punish the misuse of that value so it's sort of an ever lasting font of money.

I wholeheartedly believe that when we solve the issue of undervaluing personal information... that's when Ads become nearly worthless (like they are in print media) and software salaries deflate to the point where those useful by humans tools become the primary product again - instead of tools to use harvesting from humans.

But, I'm quite an optimist - and a cynical one at that.

Re:In spite of an increase in Internet speed, webpage speeds... by bananaface on Wednesday August 05, 2020 @12:12PM (#24062422)
But the ads don't even load quickly
Re:In spite of an increase in Internet speed, webpage speeds... by munk-a on Wednesday August 05, 2020 @02:06PM (#24063697)
This is entirely speculations but I think that may come from a very interesting factor - it's not what the engineering team views as a core competency. There may be a big divide in how the business is perceived between marketing and devs and optimizing Ads (this throw away side-component) isn't viewed as a tech priority by the team.

A more reasonable reason might just be that trying to be a platform of everything is a complex proposition and they've accepted so much complexity that all their labour at this point is being poured into maintaining that complexity rather than making improvements.

Re:In spite of an increase in Internet speed, webpage speeds... by 9HZZRfNlpR on Tuesday August 04, 2020 @05:04PM (#24054481)
Responsiveness never, it does make complex projects easier but the problem is that developers often make them complex for the sake of it.
Re:In spite of an increase in Internet speed, webpage speeds... by ly on Tuesday August 04, 2020 @05:11PM (#24054536)
I disagree with "responsiveness never". Imagine you have a "tabs" component on a page, each tab has some text (for example [1]). With javascript, you can hide the content of the first tab and show the second tab on click, almost instantly.

Without javascript the second tab would be a link to another HTML page where the second tab is shown. Exact same behaviour for the user, however the one with a few lines of javascript will feel way more responsive than the one without, where the user has to wait for a new page to load.

[1] https://getbootstrap.com/docs/4.0/components/navs/#javascrip...

Re:In spite of an increase in Internet speed, webpage speeds... by theandrewbailey on Tuesday August 04, 2020 @05:35PM (#24054739)
Without Javascript, the tab can be a label that activates a radio button next to a hidden div that also has a input:checked~div { display: block;} CSS on it. No Javascript required.

https://codepen.io/dhs/pen/diasg

Re:In spite of an increase in Internet speed, webpage speeds... by ly on Tuesday August 04, 2020 @05:48PM (#24054836)
Yeah, you're right that simple tabs can also be implemented using css, but I still disagree. Another example: how about a simple search on a table [1].

In this case the search is instant. Without JS you would have to have a submit button and wait for the request. Even if you also added a button the JS version it would still feel more responsive, as again, you're not waiting for the request.

[1] https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js...

Re:In spite of an increase in Internet speed, webpage speeds... by lelandbatey on Tuesday August 04, 2020 @06:51PM (#24055357)
I'm not sure I've ever seen a case where I have a data set that's small enough to be quickly searchable (and quickly re-renderable) using client-side JS but big enough that I need dedicated and app-like sort, search, or query functionality. And where such a set of data to exist, that data set would almost certainly be _growing_ with time, meaning even if it started out as something where I can have snappy JS search, as time passes the JS search grows heavier and slower through time.

Additionally, when it comes to client-side spreadsheets I have seen far more terrible half client-side, half server-side implementations (being only able to sort within a page, instead of across all pages of results). If I had to choose one, I'd choose a world were all we had were server side spreadsheets.

Re:In spite of an increase in Internet speed, webpage speeds... by ly on Tuesday August 04, 2020 @08:01PM (#24055834)
I’ve implemented front-end (fuzzy) search in multiple projects over the years. When the dataset is known to be small enough it’s great.

I have also seen the horrible half/half implementations you mention where it should have just been implemented on the server side, and I totally agree with you there.

However it was just an example to show that a unsubstantiated blanket statement like “responsiveness never” is just wrong. I’m not saying doing search in JS is always (or even often) better, but it can be sometimes if done well.

Re:In spite of an increase in Internet speed, webpage speeds... by robertoandred on Wednesday August 05, 2020 @12:12AM (#24057196)
And that’s absolutely terrible for accessibility. Cute clever hacks are rarely actually good.
Re:In spite of an increase in Internet speed, webpage speeds... by reaperducer on Tuesday August 04, 2020 @06:16PM (#24055083)
almost instantly

Or you can do it in CSS actually instantly.

And no, complexity generally doesn't negate this. Earlier this year I built a series of complicated medical forms for a healthcare web site that are all HTML + CSS + < 2K of jsvascript, and they all respond instantly because I did't lean on JS to do everything.

The pages are fast, responsive, work on any device, almost any bandwidth (think oncologists in the basement of a hospital with an iPad on a bad cellular connection), and the clients are thrilled.

Re:In spite of an increase in Internet speed, webpage speeds... by amiga on Tuesday August 04, 2020 @05:12PM (#24054548)
Job security!
Re:In spite of an increase in Internet speed, webpage speeds... by EE84M3i on Tuesday August 04, 2020 @09:32PM (#24056391)
Something I've noticed is that Dead Code Elimination for Javascript sucks. Yes, there are the (relatively) single "tree shaking" algorithms, but there because of various language issues, it's very hard to mark code as completely unused. Because of this it's extremely common to pull in a library and have a bunch of code that's never used in production!
Re:In spite of an increase in Internet speed, webpage speeds... by SV_BubbleTime on Tuesday August 04, 2020 @09:36PM (#24056419)
Unused code shouldn’t cause a performance issue though, should it? Isn’t this just a matter of downloading it, but never branching into?
Re:In spite of an increase in Internet speed, webpage speeds... by MereInterest on Tuesday August 04, 2020 @10:33PM (#24056717)
Performance on the web is more than just runtime. That time spent downloading the Javascript and parsing it is part of the page's load time, even if the Javascript isn't executed.
Re:In spite of an increase in Internet speed, webpage speeds... by benaadams on Tuesday August 04, 2020 @11:51PM (#24057105)
Need to both download and compile it
Re:In spite of an increase in Internet speed, webpage speeds... by vlunkr on Tuesday August 04, 2020 @05:08PM (#24054520)
I think JS does play a big role, but my guess is that the 3rd party stuff is lots heavier than the scripts that actually make the page work. You have to write tons of code before the load time even matters, but when you have a bunch of "analytics", advertising, and social media integration scripts it adds up, especially when each ad is essentially it's own page with images and scripts.

If you use Privacy Badger or similar plugins, you see that it's not uncommon for websites to have an obscene amount of these.

TLDR: I think ads are slowing the internet down way more than React apps.

Re:In spite of an increase in Internet speed, webpage speeds... by cel1ne on Wednesday August 05, 2020 @12:14AM (#24057204)
Yes, and the main culprit of JavaScript is excessive GC, because of excessive object-creation.

Developers are careless because JS is so fast, but they forget the hundreds of milliseconds of GC-pauses that occur because they never think about the memory they are allocating and throwing away each second.

Re:In spite of an increase in Internet speed, webpage speeds... by xenospn on Tuesday August 04, 2020 @04:49PM (#24054350)
Giant CSS bundles as well.
Re:In spite of an increase in Internet speed, webpage speeds... by nomel on Tuesday August 04, 2020 @05:09PM (#24054523)
Perhaps they test with simulated reduced bandwidth?
Re:In spite of an increase in Internet speed, webpage speeds... by csark11 on Tuesday August 04, 2020 @05:19PM (#24054608)
What's your site's URL?