Last modified: 2014-10-25 18:57:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68328, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66328 - mw.title should avoid unnecessary expensive work
mw.title should avoid unnecessary expensive work
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-07 18:12 UTC by Jackmcbarn
Modified: 2014-10-25 18:57 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jackmcbarn 2014-06-07 18:12:44 UTC
Currently, mw.title is implemented using Title. This results in unnecessary expensive calls in multiple situations, such as when validating a title (1 expensive call when none are necessary), and when checking whether a file exists (2 expensive calls when only 1 is necessary). For this reason, it should be modified to use the TitleValue class wherever possible.
Comment 1 Jackmcbarn 2014-06-07 18:26:04 UTC
Upon looking closer, it seems that this problem isn't caused by Title itself (and thus wouldn't be fixed simply switching to TitleValue), but by the way Scribunto grabs information about the title.
Comment 2 Brad Jorsch 2014-06-09 16:38:45 UTC
Unfortunately, the expensive work seems to be necessary. To properly purge pages that refer to the title if the page gets created or deleted, we need to record a link to it. And to record a link, we need to load the page_id. And loading the page_id for a title is the same thing that was rejected for being made not-expensive in Gerrit change #127160.
Comment 3 Liangent 2014-06-09 16:41:05 UTC
I wonder if it's possible to do lazy loading in Lua.

Obvious it's not needed to load page_id if I want to extract the namespace of a title.
Comment 4 Jackmcbarn 2014-06-09 17:55:48 UTC
What Liangent is saying is basically what I was trying to say. If you just want to validate, canonicalize, etc., there's no reason to hit the DB at all.
Comment 5 Brad Jorsch 2014-06-10 14:16:40 UTC
Hmm. Depending on the properties actually used, we may not need to record the link. So maybe we *can* get away with this in some cases.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links