Page MenuHomePhabricator

Project ID not memoized
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

getProjectId() resp. getProjectIdByProject() ('src/ReadingListRepository.php:1556-1589') query reading_list_project on every call, and the same @local project is resolved several times per request. The table is tiny and practically immutable.

Goal

Resolve a given project to its ID at most once per request.

Acceptance criteria for done

  • Resolved project → rlp_id is memoized on the repository instance (optionally also via WANObjectCache).
  • Repeated resolutions in one request issue no extra queries (verified via the POC harness).

Event Timeline

Volker_E triaged this task as Medium priority.Tue, Aug 11, 8:50 PM

Change #1324395 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/extensions/ReadingLists@master] Memoize project ID lookups in ReadingListRepository

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

Change #1324395 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] performance: Memoize project ID lookups in ReadingListRepository

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

Volker_E set the point value for this task to 2.
Volker_E updated the task description. (Show Details)

Putting directly to sign-off after @aude review/merge as this is a code-only change.

aude raised the priority of this task from Medium to High.Fri, Aug 14, 5:42 PM
Jdlrobson-WMF subscribed.
This comment was removed by Jdlrobson-WMF.