The function MetatagManager::getFields() takes about 23ms on the EvolvingWeb site. It's approximately linear on the number of fields, and the entity in question only has three fields, so it's probably worse on other sites.

It looks like the function is fetching the values of all fields, in order to check if they are metatag fields. But we don't need the values for that, just the definitions! So it should be possible to greatly speed it up.

CommentFileSizeAuthor
#5 2705851-4.patch1.29 KBvasi
#2 metatag-getfields-2.patch1.39 KBvasi

Comments

vasi created an issue. See original summary.

vasi’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

Here's a patch that uses the definitions only, it's almost-instant on our site, so fast our profiler doesn't even hit one sample.

Status: Needs review » Needs work

The last submitted patch, 2: metatag-getfields-2.patch, failed testing.

The last submitted patch, 2: metatag-getfields-2.patch, failed testing.

vasi’s picture

Status: Needs work » Needs review
StatusFileSize
new1.29 KB

Oops, had a bad root dir for the patch.

vasi’s picture

  • DamienMcKenna committed dc3ebe1 on 8.x-1.x authored by vasi
    Issue #2705851 by vasi: Load field definitions, not field values, when...
damienmckenna’s picture

Status: Needs review » Fixed
Parent issue: » #2699381: Plan for Metatag 8.x-1.0-beta8 release

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.