I've noticed that Wikipedia is, now days, extremely fast if I'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'm logged in its <i>much</i> slower - there's perhaps a second or so lag on every page view. Presumably this is because there's a cache or fast-path for pre-rendered pages, which can't be used when logged in?
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've not had experience with the new React server components, I decided to try Next.js. I'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/type of content:<p>* <a href="https://www.nray.dev/blog/using-media-queries-in-javascript/" rel="nofollow">https://www.nray.dev/blog/using-media-queries-in-javascript/</a> [total requests 13; JavaScript 2.3 kB; Lighthouse mobile performance 100]<p>* <a href="https://ray.run/blog/api-testing-using-playwright" rel="nofollow">https://ray.run/blog/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 'client side' component.<p>One other thing I noticed, you don't have /robots.txt or /rss.xml. Some of us still use RSS. Would greatly appreciate being able to follow your blog!
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://insidegovuk.blog.gov.uk/2022/08/15/the-impact-of-removing-jquery-on-our-web-performance/" rel="nofollow">https://insidegovuk.blog.gov.uk/2022/08/15/the-impact-of-rem...</a>
If the author or anyone else with the ability to update Wikipedia'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's not even great on a tablet. But there's no easy way to switch back when I'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/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.
I'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://astralcodexten.substack.com/p/mr-tries-the-safe-uncertainty-fallacy" rel="nofollow">https://astralcodexten.substack.com/p/mr-tries-the-safe-unce...</a><p>It's not that it's rendering slowly, it apparently doesn't finish rendering at all. At first a few paragraphs render, then everything disappears. I basically can'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://gtmetrix.com/reports/astralcodexten.substack.com/3y8KoFtI/" rel="nofollow">https://gtmetrix.com/reports/astralcodexten.substack.com/3y8...</a><p>That's on more modern hardware I assume.<p>I also tried <a href="https://pagespeed.web.dev/" rel="nofollow">https://pagespeed.web.dev/</a> but unfortunately it timed out before it finished. Great.
Unrelated, but this style he draws the timelines in: is it hand-written/hand-drawn, or software-generated?<p>It certainly has the overall feel and appeal of being done by hand, but I'm not sure.<p>If it's software, does anyone know which software, what's the name of this style, etc?
But is event delegation such a good idea? Sure, you're not paying the cost of attaching an event to every thumbnail. But then you're going to execute some code for every single click on the page, even if totally unrelated. Sounds inefficient to me.
<a href="https://davidwalsh.name/event-delegate" rel="nofollow">https://davidwalsh.name/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>
From the sounds of the article, that 300 milliseconds wasn'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've heard that rule of thumb that there are 5-9 machine instructions before JMP or CALL which you can find if you search "instructions per branch cpu"<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.
300ms is on a low-end android phone, which is nice, but I wonder what's the performance impact on something more modern, like a 2 year-old iPhone.
Seeing "Sizzle" 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?!?
The link hower popups were incredibly slow on my older laptop on palemoon. I just disabled javascript on wikipedia because it's written quite poorly performance wise in my opinion.
heh, event delegation was like my first interview question in software. Amazing that I've I've using Wikipedia all this time with this issue :P