Page MenuHomePhabricator

Batch userlink lookups in EventDetailsParticipantsModule
Closed, ResolvedPublic

Description

EventDetailsParticipantsModule makes 20 separate queries to query user page existence for the 20 participants it shows by default. These should be preloaded using LinkBatch, which allows us to run a single query. We should use our own UserLinker::preloadUserLinks that wraps this.

Note that usernames are currently preloaded by ParticipantsStore::getEventParticipants in order to apply the filter, even when no filter is specified. However, EventDetailsParticipantsModule itself does not get a full list of usernames, and instead calls getUserName for each user separately. So, we could also:

  • Avoid the username lookup in ParticipantsStore when there is no filter
  • Do an explicit username batch lookup in EventDetailsParticipantsModule
    • Make sure this doesn't make any extra queries when the list has already been preloaded
  • And finally, use the name list to preload links

Event Timeline

Change #1321548 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Preload user info in EventDetailsParticipantsModule

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

Change #1321548 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Preload user info in EventDetailsParticipantsModule

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