Hello there,
I'm looking for a little help with Slick performance in Drupal 10.
I have a page (node) with a Gallery field with about 250 photos. Before I switched to Drupal 10, I used the Juicebox gallery in Drupal 7, for which such a number of photos was not a problem - the website validated Core Web Vitals perfectly.
Slickbox, even though it is often mentioned as the best gallery script, is a real disaster in Core Web Vitals.
I think I did everything I could, checked various possibilities and configurations - each time the test in Lighthouse/Pagespeed Insights is only 20-40 points, because the gallery script runs for about 20-40 seconds. Such a time is a disaster these days,
The biggest problem seems to be loading all the photo thumbnails from the slider in Slick. And 250 undelayed requests to the server must result in a negative result in the tests.
I would like to ask if there is anyone of you who, with 200-300 photos in Slick, can achieve a result of about 90 in the Performance of Core Web Vitals section?
What settings do you use to achieve this? What is crucial?
Maybe Slick is just a bad choice for a gallery this size?
Thanks for all your suggestions. And your work on the module!
Szy.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | view2-d3571ea3-0f11-4408-97f6-d6cdf0aad36c.png | 40.88 KB | szy |
| #4 | view-b6c62c93-788b-4115-9aff-8c0fc7a97457.png | 54.4 KB | szy |
| #4 | nav2-69808dc6-0213-4c45-a450-dbc32b860206.png | 32.42 KB | szy |
| #4 | nav-e0ae65d4-6005-429e-818e-63be63fae26f.png | 63.24 KB | szy |
| #4 | main2-7d47584c-d361-4233-8423-419656b63438.png | 53.2 KB | szy |
Comments
Comment #2
szy commentedComment #3
gausarts commentedThank you.
> Slick performance is a disaster in Core Web Vitals
Please don't change the title, it is hilarious, anti-mainstream :)
Unlike other negative posters with 0 data, I think you are fair and good.
You provided some data, even very minimal. And you also identified the problem correctly.
I appreciated, honestly. You are not being offhanded with such a negative post.
> The biggest problem seems to be loading all the photo thumbnails from the slider in Slick. And 250 undelayed requests to the server must result in a negative result in the results.
You did identify the problem correctly.
Those thumbnails are indeed not optimized. They are just plain old images as meant for thumbnails which will of course hammer your server given 250 items, or so.
I even abandoned the idea to optimize those thumbnails from the early D7 devs, since they aren't worth any optimization due to being too small a size. Blazy is not even there.
But I think your use case may change my mind only if it is common.
Please reply any below properly so your OP may have more contexts to validate:
Existing solutions:
Comment #4
szy commentedYour previous posts on this topic made me expect this tone ;), but I really appreciate the answer, thanks.
To the point.
View config:
View caching: 6 days/6 days.
Slick - Main:
Slick - Nav:
This the effect:
https://pagespeed.web.dev/analysis?url=https://www.cyclingthread.com/cas...
Now it's 60 points, not so disastery ;), but there is still ~600 images (Main + Nav, so it's 2x ~300 images), which are analysed by the Lighthouse script! 8O
Is there anything I could do better? I was trying slider, on demand, etc, loading.
Szy,
Comment #5
szy commentedQuick thought [...]
edited&deleted - the dead end.
Szy.
Comment #6
gausarts commentedYou haven't answered all of my previous questions, so I re-highlight them below.
Obvious performance culprits
Slick optionsets:
Autoplaywill trigger immediate hammers, disable this and report.Autoplay speedandSpeedis way too fast, faster than the recommended default values. You don't even give viewers a chance to see and enjoy your images.Use CSSandUse CSS Transformso that browsers can manage and optimize transition and animation better than JavaScript alone.Infinitewill even hammer your servers with tons of requests. Although most are cached by browsers, butInfinitedestroys andrecyclesrevalidates Blazy successful requests. Obvious hammers. Try disabling them. Slick is not intelligent enough withAutoplay, nor Infinite. It is not aware of its position in the viewport. Splide is. Splide answers all those Slick culprits very well. Even withInfinitethanks to its configurable clone constraints.Slick formatter culprits:
Optionset thumbnailempty. And report back your findings. There are other alternatives to make galleries, see below._empty image_" under Fallback for better performance to avoid hammerings aka double downloads. Also visit Blazy UI to optimize Responsive image globally with 1px.slider, ordefer. The last is relevant for Autoplay below the fold. Almost similar to Splide delayed Autoplay, thus delayed image downloads, till visible on the viewport. But Slick is unfortunately less advanced.Design culprits:
or even unfixable problem with the current Slick, or even Splide. Unless you ajaxified them, meaning putting them in chunked requests, says 40 each.
defer.> Maybe Slick is just a bad choice for a gallery this size?
Bad, with the current non-optimized thumbnails given massive amounts and with the above mentioned culprits. Unless you disable Autoplay, Infinite and thumbnails in the least. However gallery alternatives exist without thumbnails:
https://git.drupalcode.org/project/blazy/-/blob/8.x-2.x/docs/README.md?r...
Lessons learned
Potential future solutions, specific for non-optimized thumbnails:
Automatically change images to lazyloaded ones once its delta hits 9 or larger, and left the below 9 non-optimized as they are now. This has been done with Loading priority named
slider. But they should bypass Blazy logic routines since thumbnails are less sophisticated than regular larger images. Patches are welcome if anyone beat me to it. Thank you.> Is there anything I could do better?
The tools and options are there to make great performance, that is why it is Documentation. Failing to take their advantages or to understand them will lead to a disaster.
Normally defaults are already optimized and fairly good for common usages until you messed them up with difficult or problematic options.
Comment #7
gausarts commentedAnother common pitfall is the underrated Aspect ratio.
Yours is good, not empty. That is why it was not mentioned previously.
Aspect ratio is useful to minimize Layout Reflow in lazyload techniques prior to Native lazy. Still useful and relevant if you disable No JavaScript options at Blazy UI.
Layout Reflow can be exaggerated like painting a wall by destroying, not scraping, the wall first. Inefficient and costly. Aspect ratio keeps the wall to paint on in place and intact.
The most obvious OP bottlenecks are:
Conclusion:
Negative posts so far are mostly due to misconfigurations -- failing to take advantage and understanding the pitfalls and benefits of the provided options. Only few are hater aka narrow-minded people problems.
Since they are just configurable options, reading and understanding the provided descriptions is a must.
Most pitfalls, not all, are already described in each form items. Ignoring them will obviously lead you to a disaster.
Basic understanding of performance subject with its own provided solutions, and common sense apply.
Above all, being aware of the options at /admin/config/development/performance is the very basic thing nobody should ignore.
Thumbnail optimization with massive HTTP requests mentioned above should be addressed by Blazy, not here. However seeing the OP misconfigurations, it is not a real bottleneck to worry about for most common usages at Slick.
Note:
Postponed due to too many dups on this subject, or in case any more inputs are needed like Aspect ratio above. Feel free to share your findings to benefit others after this comment.
This one is a good appreciable sample of constructive negativity nevertheless, so thank you again.
Comment #8
szy commentedThanks for your help, I'll post a few thoughts in a few days.
Szy.
Comment #9
gausarts commented3.x is out.
Any contribution should refer to the provided docs as outlined at project home:
https://git.drupalcode.org/project/slick/-/blob/3.0.x/docs/CONTRIBUTION....
Anyone concerned about performance should consider using data, docs, and proper tools in the light of the fundamental Drupal knowledge and the web vitals.
We had an intro talk on web vitals at Blazy some time before you posted this issue:
#3407144: Blazy 3.x Roadmap
Important!
There is also a link at Slick project home about performance benchmark. Just press CTRL + F at project home, and type "benchmark" to go to the link.
Extraordinary claim does require extraordinary evidence as they said, but so far we just don't want to boast anything, that is why the link is not so prominent. It is just a regular humble contribution anyway, IMHO.
However, be sure you know how isolation works and have something equal to compare with along with extreme condition and proper tools so to have better and purer benchmarking should you want to run your own benchmarking.
Blazy strived to address web vitals with its configurable options. Not all, not perfect either, but fairly serious and comprehensive. Not to mention those outside visible config, async decoding and the most underrated byte size where every byte counts I learned from mortendk.
Failing to understand web vitals will not only make Blazy options useless and absurd, but also may lead to a disaster as mentioned in this OP and hinted in that thread.
The same disaster applies to Drupal as well. It is a snail until you enable caches and asset aggregations at /admin/config/development/performance. Note the "performance" word at the end of the url. Failing to see to that performance page will equally lead to a disaster as seen at some invalid performance issues at this very project. Some people just don't know that performance page, and immediately jump posting wrong negativity which is not perfectly fine but also improper.
Again negativity would be fine if anyone had done their own homework in the least with fair data or benchmarks. That is why I still appreciated the OP regardless of the devastating title because he has done enough homeworks and showed more interests in having solutions than celebrating problems.
All this has been outlined in the contribution section at Slick, Blazy, etc. and their docs in general.
In short, always spend 5-15 minutes reading and understanding your "enemies" before attacking them blindly, or worse offhandedly.
That would save us both from unnecessary inconvenience and help improve contribution quality in the long run.
Feel free to update your findings should you have one.
Thank you.