New Reddit is twice as slow as old Reddit
I've seen some posts stating that the new Reddit "feels" slow, but I thought I'd try quantifying it for myself. It's true, the new Reddit is twice as slow as the old version.
If I pop open the Inspector and look at the first GET request, old Reddit takes just under 1 second, whereas the new Reddit takes about 2 seconds. Just for the root page. This is compounded by the fact that the new Reddit downloads a lot more content after the initial load, which can cause a single page load to take upwards of 10 seconds in total. In contrast, a full page load takes 3-4 seconds with old.reddit.com.
Just for reference, here's a curl for the old vs new page:
xobs@Cuboid:~$ time curl -A "broken" 'https://www.reddit.com/r/redesign/' -o new.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 172k 100 172k 0 0 49183 0 0:00:03 0:00:03 --:--:-- 49202
real 0m3.853s
user 0m0.125s
sys 0m0.266s
xobs@Cuboid:~$ time curl -A "broken" 'https://old.reddit.com/r/redesign/' -o old.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 172k 100 172k 0 0 104k 0 0:00:01 0:00:01 --:--:-- 104k
real 0m1.884s
user 0m0.141s
sys 0m0.281s
xobs@Cuboid:~$
Posted Jul 3, 2018, 2:47 AM UTC
You can’t measure the page speed with curl. The first time new reddit loads, it indeed downloads more assets, but because it’s an SAP, the second page load is potentially faster than old reddit.
You're correct, but the way OP is measuring it is actually showing an important difference.
Even with a SAP generally your browser isn't going to do anything until the html document is returned. That curl is just the html and is similar to the load time that would be experienced by a browser with JS disabled. OP's results show that even if you have JS disabled you will see content faster on the old site than the new site's server-side rendering.
Now it's possible to make this less relevant (for JS users) through web service workers, but new reddit does not currently appear to be doing that.
Also, given how much of a focus the redesign seems to have on new users; it's rather unfortunate that the downside of the new approach is most apparent to brand new visitors.
Sure, new Reddit could greatly benefit from server-side rendering in general for all the right reasons, but users with JS disabled are not the target audience, and hardly is to anybody anymore, and not the right example to use imho.
Well the thing is, that performance with JS disabled is the best possible performance, as the JS users have to wait for that, and the additional js logic.
Serverside rendering helps js users see content faster generally as well.
The point here, is that even if all the extra js in the redesign ran instantly with no cpu cost, it would still be slower at a fresh load than the old site because the initial document return is slower.
New reddit is doing server-side rendering, it's just slower than old reddit's server side rendering, and this slows down js users as well (unless service workers are used)
Gotcha!
Well, these are things that can be addressed at least. Redesign doesn't prevent optimizations. Let's hope we see more of that soon.
I would think that would make it worse, wouldn't it? The time-to-first-byte of old reddit was half of the time-to-first-byte of new reddit, at least according to the Network measurement tab in Firefox. So even before new reddit has started to send data, old reddit has downloaded everything.
Could you please tell me what SAP is? I'm having trouble resolving that acronym.
Sry, I meant SPA - Single-page App. It's not worse, as your browser is supposed to cache all those assets on first load, then never reload the window unless you close it. Each subsequent load is smaller and faster. An SPA only sends the minimum required data on each request.
Whatever the backend framework was, it'd have to get all content and user data, and merge with layout before sending to the client which reloads the window.
This "minimum" being up to 200 kb (= ~1 MB uncompressed) of XHR requests alone per post, depending on the subreddit. That's ridiculous. You could put the full HTML in there 5 times over, and still have some space left for the JSON data that they inexplicably put somewhere in the middle the HTML body.
Besides, with proper cache policies and a normal 'multi page' website you can do pretty much the same thing. All you need to do for each request is load the dynamic HTML, since all the static assets are cached.
The data is there in json form to pre hydrate the state for the JS app so that it renders the same as what the server generated.
You should maybe stop poking around at the redesign so closely if you like your Reddit account though:
https://www.reddit.com/r/StallmanWasRight/comments/8m55dm/this_is_a_diff_of_reddits_new_tos_reddit_has_gone/
That's the theory. In practice, I've never seen it work that way.