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.

300ms Faster: Reducing Wikipedia's total blocking time

509 pointsby janpioabout 2 years ago

20 comments

Reason077about 2 years ago
I&#x27;ve noticed that Wikipedia is, now days, extremely fast if I&#x27;m <i>not</i> logged in. Just about any article loads near-instantaneously, it might even be faster than Hacker News!<p>But if I&#x27;m logged in its <i>much</i> slower - there&#x27;s perhaps a second or so lag on every page view. Presumably this is because there&#x27;s a cache or fast-path for pre-rendered pages, which can&#x27;t be used when logged in?
评论 #36114785 未加载
评论 #36114597 未加载
评论 #36114570 未加载
评论 #36114540 未加载
评论 #36118208 未加载
评论 #36114568 未加载
lucgaganabout 2 years ago
Unrelated, but I love how fast your website loads. I looked at the source code, and it looks like it uses Astro.<p>I debated whether to go with Astro or Next.js for my new blog, but because I&#x27;ve not had experience with the new React server components, I decided to try Next.js. I&#x27;ve had a goal of making it have the least bloat possible, so it is kinda interesting to compare these side by side now.<p>I picked random two posts that have similar amount&#x2F;type of content:<p>* <a href="https:&#x2F;&#x2F;www.nray.dev&#x2F;blog&#x2F;using-media-queries-in-javascript&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nray.dev&#x2F;blog&#x2F;using-media-queries-in-javascript&#x2F;</a> [total requests 13; JavaScript 2.3 kB; Lighthouse mobile performance 100]<p>* <a href="https:&#x2F;&#x2F;ray.run&#x2F;blog&#x2F;api-testing-using-playwright" rel="nofollow">https:&#x2F;&#x2F;ray.run&#x2F;blog&#x2F;api-testing-using-playwright</a> [total requests 19; JavaScript 172 kB; Lighthouse mobile performance 100]<p>It looks like despite predominantly using only RSCs, Next.js is loading the entire React bundle, which is a bummer. I suspect it is because I have one &#x27;client side&#x27; component.<p>One other thing I noticed, you don&#x27;t have &#x2F;robots.txt or &#x2F;rss.xml. Some of us still use RSS. Would greatly appreciate being able to follow your blog!
评论 #36114551 未加载
评论 #36117810 未加载
评论 #36115830 未加载
评论 #36118243 未加载
robin_realaabout 2 years ago
Incidentally, if you’re interested in the performance cost of jQuery, GOV.UK posted last year an analysis of the performance gain seen when they removed jQuery in favour of vanilla JS: <a href="https:&#x2F;&#x2F;insidegovuk.blog.gov.uk&#x2F;2022&#x2F;08&#x2F;15&#x2F;the-impact-of-removing-jquery-on-our-web-performance&#x2F;" rel="nofollow">https:&#x2F;&#x2F;insidegovuk.blog.gov.uk&#x2F;2022&#x2F;08&#x2F;15&#x2F;the-impact-of-rem...</a>
评论 #36118114 未加载
评论 #36121928 未加载
评论 #36118011 未加载
wolrahabout 2 years ago
If the author or anyone else with the ability to update Wikipedia&#x27;s code itself is reading this, I have a suggestion for some low-hanging fruit that wastes a lot more than 300ms for all sorts of users, not just those on low-end mobile devices.<p>Wikipedia, like many web sites, makes it really easy for mobile users to get redirected to a mobile-specific version running on a mobile-specific domain.<p>The problem is that this mobile-specific version is not good for browsing on a full computer. It&#x27;s not even great on a tablet. But there&#x27;s no easy way to switch back when I&#x27;ve been sent a mobile-specific link other than editing the link by hand. Mobile links end up everywhere thanks to phone users just copy&#x2F;pasting whatever they have, and desktop users suffer as a result.<p>Please, anyone who develops web sites, stop doing the mobile-specific URL nonsense. Make your pages adaptable to just work properly on all target devices.<p>If you insist on doing things this way with mobile-specific URLs, at least make it equally easy for desktop users to get off the mobile URLs as you make it for phone users to get on them.
评论 #36114664 未加载
评论 #36115392 未加载
评论 #36114548 未加载
评论 #36115735 未加载
评论 #36117856 未加载
exabrialabout 2 years ago
The better question is: Why use Javascript at all for a static website?
评论 #36114221 未加载
评论 #36118447 未加载
评论 #36116420 未加载
评论 #36114258 未加载
评论 #36114223 未加载
cubefoxabout 2 years ago
I&#x27;m generally not picky with page load times (some cookie nags are far worse), but sometimes even my patience gets tested.<p>The worst offender is substack combined with many comments. I tried opening a Scott Alexander blog post in mobile Chrome on my aging mid range phone:<p><a href="https:&#x2F;&#x2F;astralcodexten.substack.com&#x2F;p&#x2F;mr-tries-the-safe-uncertainty-fallacy" rel="nofollow">https:&#x2F;&#x2F;astralcodexten.substack.com&#x2F;p&#x2F;mr-tries-the-safe-unce...</a><p>It&#x27;s not that it&#x27;s rendering slowly, it apparently doesn&#x27;t finish rendering at all. At first a few paragraphs render, then everything disappears. I basically can&#x27;t read articles on this blog.<p>This website says the above has a total blocking time of 15.7 seconds:<p><a href="https:&#x2F;&#x2F;gtmetrix.com&#x2F;reports&#x2F;astralcodexten.substack.com&#x2F;3y8KoFtI&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gtmetrix.com&#x2F;reports&#x2F;astralcodexten.substack.com&#x2F;3y8...</a><p>That&#x27;s on more modern hardware I assume.<p>I also tried <a href="https:&#x2F;&#x2F;pagespeed.web.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pagespeed.web.dev&#x2F;</a> but unfortunately it timed out before it finished. Great.
评论 #36114967 未加载
评论 #36114978 未加载
评论 #36115415 未加载
评论 #36118347 未加载
zodzedziabout 2 years ago
Unrelated, but this style he draws the timelines in: is it hand-written&#x2F;hand-drawn, or software-generated?<p>It certainly has the overall feel and appeal of being done by hand, but I&#x27;m not sure.<p>If it&#x27;s software, does anyone know which software, what&#x27;s the name of this style, etc?
评论 #36117766 未加载
flaburganabout 2 years ago
But is event delegation such a good idea? Sure, you&#x27;re not paying the cost of attaching an event to every thumbnail. But then you&#x27;re going to execute some code for every single click on the page, even if totally unrelated. Sounds inefficient to me.
评论 #36117852 未加载
jonatronabout 2 years ago
<a href="https:&#x2F;&#x2F;davidwalsh.name&#x2F;event-delegate" rel="nofollow">https:&#x2F;&#x2F;davidwalsh.name&#x2F;event-delegate</a> <i>By David Walsh on March 7, 2011</i><p><i>One of the hot methodologies in the JavaScript world is event delegation, and for good reason.</i>
samsquireabout 2 years ago
From the sounds of the article, that 300 milliseconds wasn&#x27;t much addition or math or number crunching but essentially book keeping and querying.<p>A lot of that crunching is either whittling through DOM traversals.<p>I&#x27;ve heard that rule of thumb that there are 5-9 machine instructions before JMP or CALL which you can find if you search &quot;instructions per branch cpu&quot;<p>If I had a database of 4,000 links and instantiated a function event handler to each one, that would be slow. But if I could invert the problem and test if the clicked object is inside an active query resultset, that could be fast. It could be automatic.
estabout 2 years ago
Google&#x27;s homepage, just a simple text box with a search button is over 1MB.
评论 #36114954 未加载
e63f67dd-065babout 2 years ago
300ms is on a low-end android phone, which is nice, but I wonder what&#x27;s the performance impact on something more modern, like a 2 year-old iPhone.
评论 #36114196 未加载
cutlerabout 2 years ago
Can someone please do the same for Hacker News? For a text-based site it&#x27;s dog slow.
评论 #36117794 未加载
floatbothabout 2 years ago
Seeing &quot;Sizzle&quot; in that profile made me feel shocked. Uhhh Wikipedia actually still uses an ancient build of jQuery that does not take advantage of native querySelector at all?!?
评论 #36116437 未加载
jesprenjabout 2 years ago
The link hower popups were incredibly slow on my older laptop on palemoon. I just disabled javascript on wikipedia because it&#x27;s written quite poorly performance wise in my opinion.
6510about 2 years ago
My motto is: It isn&#x27;t fast until you have to disable gnu zip
pachicoabout 2 years ago
&gt; Remember, the fastest way to speed up a site is to remove JavaScript.<p>I&#x27;m not entirely sure this can be so axiomatic...
评论 #36115139 未加载
lumb63about 2 years ago
I continue to wonder how much computing power and human time is wasted on grotesquely sub optimal code.
winridabout 2 years ago
heh, event delegation was like my first interview question in software. Amazing that I&#x27;ve I&#x27;ve using Wikipedia all this time with this issue :P
dcj4about 2 years ago
Just disable javascript like any sane person. Wikipedia, like most websites, has no use case for javascript whatsoever.
评论 #36120014 未加载
评论 #36118398 未加载