metatag_entity_load() uses metatag_entity_supports_metatags() for querying entities metatags instances, but it could reduce the $revision_ids by first checking if the bundles are enabled, thus potentially reducing the number of SQL queries.

Comments

Status:Active» Needs review
Issue tags:+Performance
StatusFileSize
new2.77 KB
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

For example, the given patch applied on a module where lives something like 50 node types but only 4 of them are enabled to use metatags (using hook_entity_info_alter()) saves us an average of 30 SQL queries per page, which is significant.

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new2.53 KB

And here is a patch for the current version.
Patch has been done with a manual diff, so you need to:

patch -p0 < PATCHFILE

manually to apply. Drush make will apply cleanly.

Status:Reviewed & tested by the community» Needs review

StatusFileSize
new3.07 KB
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

@pounard: Thanks for the patch. I've made a few minor tweaks.

Looks good to me, glad I could help.

Issue summary:View changes
StatusFileSize
new3.58 KB
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Rerolled.

StatusFileSize
new3.62 KB
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Rerolled.

Status:Needs review» Needs work

This needs work.