Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

0 votes

(This is posted in miscellaneous, as I don't know where else to put it).

I have been benchmarking a bit, since the Profile Stats page is unbelieavbly slow on my machine. I took a much faster machine to not have the bottleneck being the CPU of my somewhat aging laptop. I thought that maxcdn was the culprit, as the message I usually get is "Waiting for", but that turned out not to be the case once benchmarked on a more beefy machine. Both response time and throughput is fine with the maxcdn. I did, however, stumble upon another quite odd thing that brings about the following question:

How come that the Profile Stats are loading the full version pictures of the souvenirs earned ?

The full size of my profile stats page is a little over 20MB when loaded without anything cached in advance, the vast bulk of which is served from (17,8MB). The vast bulk of that are the full-size (300x400 px or so) images that belong to the individual souvenirs. They appear inside elements hidden by CSS. Clicking the individual souvenirs on the profile page appears to do nothing.

I realise that

  1. The images are cachable, so that reloading the page will result in a 304 on all images, thus reducing the total size of the page that needs to be loaded from to a mere 84KB
  2. The images are served from so that does not put extra load on or

That does not, however, explain the need to load them in the first place - or why should be made to serve the client (which should load and cache) some 10+MB of data that does not appear to be used for anything. Is there a reason that these elements are loaded, or have they been forgotten ?

To be clear: We are not talking about the thumbnail versions of the souvenirs that are displayed in the Souvenirs tab.

closed with the note: Question answered by ganja1447
in Miscellaneous by Funky_Boris (9.8k points)
closed by Funky_Boris

1 Answer

0 votes
Best answer
I am quite sure the Souvenirs has been clickable before, seems like some Javascript isn't working as intended. Regardless it could probably be wise if the images weren't loaded before they were needed. But it doesn't feel like the highest priority either.

The page is heavy, and even though it's a lot of data on those images I doubt they are the cause of your load in your browser. It can easily be tested by pointing that host to in the hosts-file for example.

The page is quite heavy because every "module" is fetched with ajax. There is a work queue in Javascript fetching several modules at once, so that they are rendered in parallel.
by magma1447 (Admin) (239k points)
selected by Funky_Boris
Right. The javascript/AJAX model is probably the explanation of why a more beefy machine can load it pretty fast while my not-beefy-indeed 7 year old netbook takes minutes. CPU performance does tend to make a big difference in how fast javascript executes.

My point about the large image versions of the souvenirs still stands, though.
To be clear: I am not chastising you for making the page load faster on newer machines. I am not convinced that doing a more "traditional" approach to loading the page (static html) would even be faster. If anything, I think a majoriry of your users feel that the AJAX model provides an increase of performance, not the opposite.

Anyway, I am selecting the response as "best response", because it signifies that project-gc is now aware of this problem with the unseen full size versions of the souvenirs, which was the original intention. When and if to do something about it is now up to you :)

Thanks again for a great site and a great service - including taking time to respond to these kinds of questions :)
The upside of the AJAX model is that we can utilize more than one CPU in our end. The site is written in PHP like most other sites, a language without threading.

By making the web browser make several requests in parallel we "solve" that. To be honest I sometimes get a "wait for JS?" popup in Chrome on my i5-3570K as well. At some point we will rework the flow of the Profile stats. Optimizations will probably not happen before that.

The Souvenirs-tab uses a lightbox-script (or similar, don't remember the exact library). When fixing so that it actually works again we should investigate if we can avoid the preloading of the fullsize images. That would then save all that bandwidth.
A fine and thorough answer. I will be closing the thread now :)