Performance issues with Discourse 3.0

Caching is done automatically by the browser unless it is prevented for one reason or another. However, I don’t understand why it doesn’t seem to be cached. Maybe a web developer can chime in here?

  • not sure what “service worker” in the “Transferred” column means. Usually it should say how many bytes were transferred or “cached” if that resource is cached. Anyone know what this means?
1 Like

Maybe you accidentally activated “Deactivate Cache” in DevTools? For me Caching works, only about 700kb are transferred

Okay, nevermind. I found the documentation for the Transferred column - in a nutshell “service worker” means that the caching is handled by a service worker and that no bytes were transferred. The developer tools in Edge are clearer in that it also displays the bytes transferred

In conclusion, it doesn’t seem to be a caching issue at all. What is always transferred without cache is the html page itself, but this page for example is just 40kB.

No, I have not activated that option. Curious:

  • your Firefox shows only 729kB were transferred
  • my Firefox shows 1480kB were transferred
  • my Edge shows only 42kB were transferred

:confused::question:

What page were you testing on? I just used this topic page. Maybe there were differences in how much new content was there at reload time?

But I wouldn’t worry too much about it, 500kb to 1.5 MB transfer size are really not much compared to most other websites.

I measured the amount of data actually received by my computer. Using Firefox.
First load: 1,77 MB
Second load: 32 kB
So the caching works fine. :smiley:

Moving the performance conversation to a new topic for better tracking.

@Firefishy bringing this to your attention :slight_smile:

1 Like

Depending on where you are, that might be the case. In some places that might be enough to make using this site financially impossible.

Separately from that I find that even on a fast mobile broadband connection (31Mbps down) it takes about 5 seconds to load the first page, and 4-5 seconds to load subsequent ones**, following a link from an email. A snappy conversation it is not - if any of the systems I used to work on back in the 80s were that slow on every page load they’d have been thrown out.

** Firefox, Nokia 6.1, Android 10. On a newer phone (Nokia X10, Android 13) it’s about 3 and 2 seconds respectively. better; but still not great.

1 Like

While I sympathise with anyone having issues with the caching / download size issues with the website, we are running a fairly standard install of discourse. Any issue will likely need to be fixed upstream.

Modern browsers use the brotli compressed assets. Older browsers use gzip compressed assets. Make sure to use network transferred bytes, rather than uncompressed asset size when using web developer tools.

I have briefly tested using the latest Chrome and Firefox, after an initial large set of JS/CSS etc downloads, the subsequent pages load using less than 100KB of new downloads.

2 Likes

I can’t reproduce that though. It takes about 1 second on an Android 11, Firefox, with 1 of 4 bars of 4G connectivity. Which is plausible given that on reload, something like 40kB or so are actually transmitted.

1 Like

I will agree here. In fact, OSM instance opening random thread even seems to load noticeably faster (2.5s largest contentful paint) then discourse own instance (4.2s largest contentful paint).

Thus I would suggest that people who are having performance issues on community.openstreetmap.org try meta.discourse.org too. If that instance is noticeably faster then OSM one, than there are things that can be addressed here. If it is about the same slowness, than any request for performance improvements should be taken with Discourse developers.


This webpagetest.org waterfall graph shows about half the time of that 8 seconds is just javascript pegging up the CPU without any data even attempting to load. You may also wish to test and compare your hardware+browser rendering speed in Speedometer 2.0 (e.g. my laptop gets 112 runs/min in Firefox, 178 in Chromium; P30Pro only 35 in IceCat and 40 in Firefox Klar; and Galaxy S II only manages 7 runs per minute).

Discourse is unfortunately Javascript-based beast, which means that it offloads much of the work to the client, which means the slower the device (read: mobile phones, especially the ones that are not newest top-of-the-line ones) are likely going to suffer.

For example:

  • on my Huawei P30 Pro, clicking on random no-yet-visited thread on OSM instance on 50Mbps Internet link, takes about 2.2s to fill the screen with data (i.e. largest contentful paint).

  • on my old Samsung Galaxy S II, using that same Internet link, that same page shows in about 3.8s. (and complains about unsupported browser, likely meaning not all functionality has been loaded. It displays article just fine, though).

  • on my 11th Gen i5-1135G7 @ 2.40GHz laptop, again on the same internet link, it shows in about 1.2s.

Grim statistic offered by Chrome Lighthouse (available via F12 keypress) while it evaluates performance say than almost 70% of mobile pages take almost 7s to load (and then proceed to say how much conversions you are likely to lose because of that).

3 Likes

It’s the beast part I have trouble with here. It’s loading and displaying text and a few sporadic images, a thing browsers already do and have done for the last 25 years. Most of the fancy functions don’t have to do anything until you click on them. Why must everything get bloated until it feels like dialup?

4 Likes

I wonder how hard it would be to crawl the site or part of it periodically to provide static HTML for a few key areas? A wget of this thread definitely looks like an improvement - relative links to e.g. https://map.atownsend.org.uk/categories obviously don’t work on that page but I find the presentation there vastly superior to the presentation here (all the text is there, the only pictures are the ones that matter, no silly boxes asking “has your question been answered”, “2 Likes” instead of silly symbols, etc.).

Well, me too. Unfortunately, that discussion either:

Yeah
 The problem is developers usually have beast of computers, and make programs which work OK-ish on them (which means they work quite bad for most everybody else). My solution was that it should be required by law that any software developer must be forced to use at least 10 year old technology (or older) and be denied access to newer tech. That way that specific problem with bloat would solve itself automagically (although it might induce other tiny problems, like nobody wanting to be a developer :rofl:)

I wonder how hard it would be to crawl the site or part of it periodically to provide static HTML for a few key areas?

Not too hard I guess, but looking at that example of yours seems to completely break Discourse navigation (which, in any thread with more than dozen messages, is absolutely vital to be able to make sense od Discourse discussion at all, much less participate in it). While who replied to what could be simulated with regular HTML anchors, it would need something little more advanced than wget.

Perhaps additional extra-light Discourse theme (akin to mbasic.facebook.com) would be better suited (have anybody looked if something like that exists?)

(for those wanting that pute wget behaviour, then can have it already by simply disabling javascript for this site, for example with uBlock-origin, NoScript or similar browser add-ons).

1 Like

How’s performance now that we have updated to 3.1?

For me it’s still struggling on a combination of poor wifi plus poor cellular coverage, but I suspect that’s a fundamental design issue of the “everything in Javascript” design.

2 Likes

No, seems to be “about the same”. Tapping a link on a phone with good 4G coverage still takes about 5-7 seconds for the page to appear. Same phone as above.

1 Like

A year (and some Discourse upgrades) later, and the situation does seem to have improved a bit.

It’s a bit anecdotal, but it does seem to be more usable on an older phone.

Same here, crawling on desktop browser and it feels like getting slowe as the threads build up over time not to speak of long threads, thankfully there’s the near invisible to me (white background) short scrollbar to drag the thread down to the last post. Opposed, snappy on mobile phone, model circa 2021 on Android.

Bit of testing, dark theme on Mozilla Firefox with their Gecko engine is substantially faster than Vivaldi which uses the Chrome engine. Short thread scrollbar is much better visible.

I’ll let you in on a secret: one of OSM Americana’s developers (yours truly) just finally moved on from a more-than-decade-old Mac on its last legs. Me clutching to that computer hasn’t done much to keep the application from getting more bogged down and bloated than we’d like. I’d contend that feedback from mobile phone users serves as a better forcing function anyhow.