Last modified: 2013-09-27 01:19:10 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 T56482, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54482 - a new key for faster search mw.title.new()
a new key for faster search mw.title.new()
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-23 21:41 UTC by Rical
Modified: 2013-09-27 01:19 UTC (History)
3 users (show)

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


Attachments

Description Rical 2013-09-23 21:41:12 UTC
In scribunto, a call to mw.title.new("page name") is very expensive.

I'm not sure, but it may be a way to accelerate: calculating a key on a 64-bit integer, like a CRC, from the name of the page, and creating an index on that key.

Because there may be duplicates on this key, it would lead to a short table of some pages, fast to manage.

Perhaps we could include versions in the CRC.
And even wiki-name ?

Overall, we would change a heavy search to a fast search.
Comment 1 Brad Jorsch 2013-09-24 16:38:56 UTC
(In reply to comment #0)
> In scribunto, a call to mw.title.new("page name") is very expensive.

{{citation needed}}

How is it "very expensive", and how would calculating CRCs and such improve matters?
Comment 2 Rical 2013-09-26 21:27:17 UTC
Sorry, the function mw.title.new( id ) is "expensive" in the Lua manual.

Perhaps the cost is due to the search of the page by comparing full page names with others. In this case, to accelerate this comparing we could compare short int64 keys rather than full names. These keys could be computed like CRC polynoms from the full names.

Such keys change the sorting of pages, but this no matter because the goal is only "exists-or-no".
Comment 3 Brad Jorsch 2013-09-27 01:19:10 UTC
(In reply to comment #2)
> Sorry, the function mw.title.new( id ) is "expensive" in the Lua manual.

Yes, that's because we don't want people doing thousands of database lookups to load (or check the existence of) thousands of title objects. Adding CRCs isn't going to change that, because it's the thousands of database round-trips we're wanting to avoid.

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


Navigation
Links