Page MenuHomePhabricator

AddMediaInfo: Batch imageinfo requests vs. serializing them
Closed, ResolvedPublic

Description

Parsoid/JS had a lib/mw/Batcher.js that batched MediaWiki API requests and so, AddMediaInfo's serialized requests would get batched before they went out on the network.

However, Parsoid/PHP does not have a backend batcher. The requests go through one of the DataAccess layers.

Since Parsoid/PHP is synchronous code, this batching ability has to be built into AddMediaInfo by restructure that code to issue requests in batches and process results after all batches are processed.

Caveat: By batching imageinfo requests, we may potentially defeat DB query caching. So, this needs to be done carefully with appropriate research / evaluation.

Additionally, we should also deduplicate requests for the same image -- this is especially an issue on pages that use a lot of icons (flags, yes/no checkmarks images, etc.) in tables.

Event Timeline

ssastry triaged this task as Medium priority.May 1 2020, 5:00 PM
ssastry created this task.

Since Parsoid/PHP is synchronous code, this batching ability has to be built into AddMediaInfo by restructure that code to issue requests in batches and process results after all batches are processed.

Or, rather, restored to the pre-porting state.

Change 726175 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] [WIP] Deduplicate file info requests

https://gerrit.wikimedia.org/r/726175

Change 726175 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Deduplicate file info requests

https://gerrit.wikimedia.org/r/726175

Change 729996 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to v0.15.0-a3

https://gerrit.wikimedia.org/r/729996

Change 729996 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to v0.15.0-a3

https://gerrit.wikimedia.org/r/729996