TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The impact of removing jQuery on our web performance

315 pointsby kevinakalmost 3 years ago

24 comments

fleddralmost 3 years ago
The team at gov.uk is doing an excellent job regarding web performance, credit where credit is due. In many ways role model behavior.<p>Still, the results are such a stretch as to not have that much meaning. They have to descent all the way to 2G to see any meaningful difference, and I&#x27;m assuming they are cold visits (typical in lab-based testing).<p>For those exceptional users, this creates a difference from very poor (12 seconds) to still poor (9 seconds). Probably less because they&#x27;d normally have a warmed up cache.<p>Is it empathetic to improve performance for those users? Very much yes, do it as far as you budget allows for. But as it comes to jQuery specifically, the conclusion is that its negative impact is negligible.
评论 #32482874 未加载
评论 #32482530 未加载
评论 #32482943 未加载
评论 #32482747 未加载
评论 #32484040 未加载
评论 #32483697 未加载
ctrlmetaalmost 3 years ago
Has anyone noticed how all UK government websites like <a href="https:&#x2F;&#x2F;www.gov.uk&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.gov.uk&#x2F;</a>, <a href="https:&#x2F;&#x2F;www.nhs.uk&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nhs.uk&#x2F;</a>, <a href="https:&#x2F;&#x2F;tfl.gov.uk&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tfl.gov.uk&#x2F;</a>, <a href="https:&#x2F;&#x2F;coronavirus.data.gov.uk&#x2F;" rel="nofollow">https:&#x2F;&#x2F;coronavirus.data.gov.uk&#x2F;</a> have the same look-and-feel and the same UX? Are there more such examples of countries that have uniform UX for their government websites?
评论 #32480964 未加载
评论 #32480943 未加载
评论 #32481044 未加载
评论 #32480948 未加载
评论 #32480957 未加载
评论 #32480967 未加载
评论 #32481001 未加载
评论 #32489731 未加载
评论 #32481858 未加载
评论 #32481511 未加载
评论 #32482520 未加载
评论 #32485767 未加载
评论 #32480947 未加载
评论 #32480944 未加载
评论 #32481703 未加载
评论 #32480949 未加载
评论 #32482404 未加载
评论 #32481678 未加载
bar8uyralmost 3 years ago
That&#x27;s nice but when you load the actual universal credit login page it needs nearly 400kb of reactjs - not sure about after that, don&#x27;t have an account..<p>Some (most?) of the other gov uk sites have megabytes of js on them.. eg. <a href="https:&#x2F;&#x2F;coronavirus.data.gov.uk&#x2F;details&#x2F;testing?areaType=nation&amp;areaName=England" rel="nofollow">https:&#x2F;&#x2F;coronavirus.data.gov.uk&#x2F;details&#x2F;testing?areaType=nat...</a>
评论 #32487905 未加载
sanitycheckalmost 3 years ago
Honestly if they&#x27;d just used jQuery instead of React all the way through they&#x27;d be loading a lot less JS and performance would be vastly better on those slow old devices. After all, jQuery was made for the slow old devices, in the time they were not slow or old.<p>The real problem is that jQuery is not new and shiny, and nobody wants to be doing jQuery in 2022.
评论 #32483238 未加载
评论 #32482711 未加载
rob74almost 3 years ago
&gt; <i>Now I know what you may be thinking, that doesn’t sound like a lot of data, especially compared to images which can be multiple megabytes in size. But when it’s on every page, from a web performance perspective, it equates to a lot of data.</i><p>Er... the utility of jQuery in 2022 aside, I would say: if it equates to a lot of data when it&#x27;s on every page (of a single website), you&#x27;re doing something wrong?! I mean, caching content between different domains is not a thing anymore, but on the same domain jQuery should only be loaded once?
评论 #32481051 未加载
评论 #32481029 未加载
评论 #32481042 未加载
评论 #32481606 未加载
评论 #32481037 未加载
评论 #32481019 未加载
myfonjalmost 3 years ago
What I miss in this otherwise excellent article is more insight about methodology. There is just murky<p>&gt; We run tests every day on GOV.UK pages using specific simulated devices and connection speeds. Because we can repeat these tests every day, it allows us to monitor what the changes we are making to the site are doing for real users visiting GOV.UK.<p>with no mention whether those were all cold start loads or simulated browsing scenarios.<p>Not wanting to diminish the effort or challenge the conclusions — I know that jQuery does quite a lot checks and feature detecting stuff when it initializes, even when it is not used (so removing it <i>must</i> have significant impact) — but if those measurements were done with cold start empty cache single loads each time, it might count some &quot;extra&quot; time (download, parse, tokenize, build AST) that usually precedes only initial load and &quot;first run&quot; of static library and is not present in subsequent interactions.
评论 #32481068 未加载
评论 #32481027 未加载
iopqalmost 3 years ago
When I did web development, I specifically loaded JS lazily so first you got a pure HTML page with just a few lines of code. Those lines of code are normal (not jQuery) JS that loads the rest of the JS lazily in a progressive enhancement. This means the page can start being rendered before the jQuery code loads.<p>But in fact, jQuery is largely not needed since Internet Explorer lost market share and there&#x27;s less of a need to have lots of workarounds for it.
评论 #32480910 未加载
评论 #32481134 未加载
评论 #32481201 未加载
xanthipposalmost 3 years ago
However the page uses jQuery?<p>&lt;script type=&#x27;text&#x2F;javascript&#x27; src=&#x27;<a href="https:&#x2F;&#x2F;insidegovuk.blog.gov.uk&#x2F;wp-includes&#x2F;js&#x2F;jquery&#x2F;jquery.min.js?ver=3.6.0" rel="nofollow">https:&#x2F;&#x2F;insidegovuk.blog.gov.uk&#x2F;wp-includes&#x2F;js&#x2F;jquery&#x2F;jquery...</a>&#x27; id=&#x27;jquery-core-js&#x27;&gt;&lt;&#x2F;script&gt;
评论 #32481730 未加载
评论 #32481725 未加载
bluenotebo0kalmost 3 years ago
Honestly I feel like jQuery is my &quot;secret weapon&quot; similar to how Lisp is Paul Graham&#x27;s in Beating the Averages. It&#x27;s so much more productive than vanilla JS with negligible impact on performance, especially with caching.
评论 #32486279 未加载
评论 #32482224 未加载
denton-scratchalmost 3 years ago
&gt; especially compared to images which can be multiple megabytes in size<p>Please don&#x27;t put images of multi-megabytes size on web-pages. My boss put a 10-megabyte image on the homepage of one of our clients; he fancied himself a photographer, and he took the photo. It gave a 10s page-load time from a desktop PC. I offered to shrink it for him, which would have taken 2 minutes; he wasn&#x27;t having it.<p>I don&#x27;t think it was pride in his photo; I think the client wasn&#x27;t paying their bills, and he wanted to punish them.<p>But please, shrink your images to fit on the screen of your most-capable target device. There&#x27;s no need for super-hi-res posters on websites.
评论 #32483432 未加载
p4bl0almost 3 years ago
&gt; But when it’s on every page, from a web performance perspective, it equates to a lot of data.<p>How does browser caching come into play here? Doesn&#x27;t it make a difference?
评论 #32481072 未加载
评论 #32481053 未加载
seydoralmost 3 years ago
Maybe. JQuery reduces the number of characters you need to write compared to vanillaJS , so if their websites use some JS , it was probably a benefit. Now tell me about the megabytes of javascript that their new fancy frameworks download, <i>uncached</i>
goodpointalmost 3 years ago
&quot;&quot;&quot; Since these users have the slowest devices, they’ll need the most help to make sure their visit to GOV.UK is as fast, efficient and as cheap as possible &quot;&quot;&quot;<p>If only web developers cared about *all* users the web would be much less crappy.
caerilalmost 3 years ago
&gt; But when it’s on every page, from a web performance perspective, it equates to a lot of data.<p>Author of this article is apparently unaware of browser caches.<p>&gt; JavaScript is known as a “render-blocking” resource.<p>Yeah, if only there was, like, an async attribute or something.<p>&gt; The graph below shows time to interactivity dropped from 11.34 seconds to 9.43 seconds<p>So, jQuery is way too heavy for these people, but interaction tracking analytics (these packages usually <i>start</i> around 200kB) is perfectly fine?<p>&gt; total page load time dropped from 19.44 seconds to 17.75 seconds<p>Burying the lede here, if my team celebrated a 17 second page load, we&#x27;d be fired on the spot. Going out on a limb here to suggest jQuery is the least of their problems.
remramalmost 3 years ago
Why is jQuery &quot;render-blocking&quot;? Wouldn&#x27;t loading it at the end of the HTML or with the `async` attribute fix that?
pkruminsalmost 3 years ago
I’m still a huge fan of jQuery. When I start a new web project then the first thing I do is add jQuery to the project. This is pretty much the only dependency that I ever use in my web projects. Nothing can beat the short “$” function and effects such as fadeIn, fadeOut, and others.
SavageBeastalmost 3 years ago
&quot;But when it’s on every page, from a web performance perspective, it equates to a lot of data.&quot;<p>Caching? Set cache headers such that the jquery.js rarely&#x2F;almost never expires and requires a re-fetch?
chippyalmost 3 years ago
Couple of relevant previous discussions around this subject:<p>Gov.uk drops jQuery from their front end (90 days ago|437 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31434434" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31434434</a><p>How and why we removed jQuery from Gov.uk (5 days ago|43 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32423422" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32423422</a>
roschdalalmost 3 years ago
jQuery is still wonderful.
评论 #32482525 未加载
petesergeantalmost 3 years ago
&gt; But when it’s on every page, from a web performance perspective, it equates to a lot of data<p>It&#x27;s not cached?
pavelevstalmost 3 years ago
It’s so nice to know that someone still case about web performance. In a world where it’s quite normal to see website with static information and 1-5MB of compressed JS, which takes long time to load and makes your device hot
yokoprimealmost 3 years ago
jQuery was nice in a pre transcompiled js world, but those days are long gone.
评论 #32482993 未加载
评论 #32482801 未加载
throwaway0asdalmost 3 years ago
Deleted.
评论 #32480968 未加载
Frontend_devsalmost 3 years ago
At the end he said a certain cohort of users, but how many users were actually in that cohort? JQuery is an older technology. I find it hard to believe something made to work on older hardware &#x2F; internet is affecting performance that much. We have 5G and stupid fast chips in phones now. I’m skeptical. Performance issues are usually database queries or code compiling &#x2F; “waking up” some server function.
评论 #32482006 未加载
评论 #32481357 未加载
评论 #32481382 未加载
评论 #32481935 未加载
评论 #32481807 未加载
评论 #32481354 未加载
评论 #32481321 未加载