Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Performance issues in element index when entry thumb is displayed #14760

Open
thupsi opened this issue Apr 4, 2024 · 3 comments
Open
Labels

Comments

@thupsi
Copy link

thupsi commented Apr 4, 2024

What happened?

Description

When navigating to an entry index with entry thumbs enabled (via the entry type settings) performance is abnormaly slow.

Testing parameters

Structure with 154 entries, 76 of them with thumbnail, display mode "structured table" (plain table is about the same, cards is even slower)

Performance of "get-elements" action:

No thumbnails:
Processing time: 293 ms
Peak memory: 6.386 MB
Query count: 134

With thumbnails:
Processing time: 1,824 ms
Peak memory: 32.676 MB
Query count: 555

And now for a surprise...
"With thumbnails" but also with an additional column showing the same image thumbnail:
Processing time: 465 ms
Peak memory: 9.988 MB
Query count: 374

Comments

  • The "with thumbnails" timings are about 6x of "no thumbnails"
  • The "with thumbnails" timings are much lower when a column with the same image is added to the table. This clearly demonstrates that something fishy is going on!

Craft CMS version

5.0.1

PHP version

8.3.2

Operating system and version

No response

Database type and version

MySQL 8.0.33

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

@thupsi thupsi added the bug label Apr 4, 2024
@thupsi
Copy link
Author

thupsi commented Apr 5, 2024

Additional testing

No entry thumbnail, but using additional column with image
Processing time: 410 ms
Peak memory: 8.859 MB
Query count: 258

Also I checked the DB queries for each of the above cases and filtered with "assets":

With entry thumbnail:

image

With entry thumbnail and image column:

image

Image column only:

image

(With no thumbnail and no image column there obviously where no duplicated queries nor queries with the word 'assets')

@thupsi
Copy link
Author

thupsi commented May 15, 2024

Hey @brandonkelly! I see that you pushed d6a3117 that addresses this issue. Just a heads up: With that fix in place, when I switch a structure's view to plain table or card view, the thumbnails dissapear.

@thupsi
Copy link
Author

thupsi commented May 15, 2024

Whoops! Scratch that last comment, it works just fine: Due to the table sorting the entries with no thumbnail where displayed at the top! 🤪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant