Page 1 of 1

Poor performance in Safari

Posted: 21 Oct 2016, 08:37
by locher
Hi,

I am experiencing performance issues in Safari on Mac when loading a pretty large gallery. 
It has >300 images and uses a justify layout. Here it is: http://x3.locher.ru/travel/asia/nepal/2010/
I open it by a click from its parent folder, http://x3.locher.ru/travel/asia/nepal 
In Safari it takes more than 12 seconds to load the contents of the page, while in Google Chrome and Firefox it is much faster - about a second or two (I did several attempts in each browser, results are stable, so the caching should not be the case).

Safari's version is 10.0, I am running Mac OS Sierra on Late 2013 MacBook Pro Retina 15"

Re: Poor performance in Safari

Posted: 21 Oct 2016, 11:57
by mjau-mjau
locher wrote:I am experiencing performance issues in Safari on Mac when loading a pretty large gallery. 
It has >300 images and uses a justify layout. Here it is: http://x3.locher.ru/travel/asia/nepal/2010/
Hmm, I can confirm. I was aware that processing the justified-layout was relatively heavy (proportional to the amount of images), although this is mostly noticeable on mobile-devices when there are hundreds of images. However, your discovery seems like a NEW issue in a Safari-update, which I didn't noticed earlier. Justified layout should not be that much slower in Safari than other browsers from the same device.

I will do some more tests tomorrow. In the meantime, you may need to use another gallery-layout, especially if the page has several hundred images.

Some related comments:
  • For some reason, the issue does not seem proportional with the amount of images ... but rather directly related to the large amount of images itself. For example, the justified layout in our demo gallery appears almost instantly in Safari ... Although there are only 46 images, you would expect it to take at least 2 seconds (proportionally speaking).
  • We are considering a new justified-layout engine using modern CSS (flex-box), which should be several times faster than the current javascript-layout method. This won't be available immediately though ...
  • I'm thinking now that small/mobile screens (<= 640) should probably bypass the justified layout. Seems pointless to process justified layout on a small screen where (in most cases) all the images stack vertically anyway.
Thanks for reporting.

Re: Poor performance in Safari

Posted: 21 Oct 2016, 17:07
by locher
Thanks! Switching from Justified to Grid did help indeed. Also it became much better on mobile: the same gallery was almost impossible to browse on iphone 6 (in both Chrome and Safari), so your hint on changing the layout solved the problem for mobile version as well.

Still I like justified more (yes, it's quite useless on smartphone, but on large screens it looks awesome), so looking forward for both fix on desktop safari and an option to bypass it on mobile.

Thanks again!

Re: Poor performance in Safari

Posted: 15 Nov 2016, 10:10
by mjau-mjau
This was fixed in X3 Release [0.21]
https://forum.photo.gallery/viewtopic.php?f=51&t=9157