This afternoon I was helping someone profile a slow page in #drupal-support during which I found out the following:

During the execution of media_wysiwyg_filter() a file_load() is issued for each individual media tag. I spent some time rewriting portions of that functionality to first extract all tag information, then load all relevant files at once via file_load_multiple() and then replace the tags.

Out of time now, but uploading patch for testbot to take a look.

Comments

legolasbo created an issue. See original summary.

legolasbo’s picture

Issue summary: View changes
dshields’s picture

This drastically reduces the load time of the node edit page when there are many media tags included in the node!

Thanks for the patch!!

chris matthews’s picture

Status: Needs review » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team

legolasbo’s picture

Status: Closed (outdated) » Needs review

I'd say, take a look if this still applies, because it drastically improves performance

Status: Needs review » Needs work

The last submitted patch, batch-replace-media-wysiwyg-tokens.patch, failed testing. View results

legolasbo’s picture

Status: Needs work » Closed (outdated)

I guess this is outdated indeed