Last modified: 2012-08-01 19:56:24 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 T30119, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28119 - Babel::getName() should cache its results, or redundant calls be reduced.
Babel::getName() should cache its results, or redundant calls be reduced.
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Babel (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-19 17:09 UTC by Purodha Blissenbach
Modified: 2012-08-01 19:56 UTC (History)
6 users (show)

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


Attachments

Description Purodha Blissenbach 2011-03-19 17:09:39 UTC
So as to generate an inner babel box for a language,
the static function getName($code, $language)
is called eleven (11) times with the same $code,
and $language (almost) alternating between the wiki
language code  (for the tranlated name) and $code
(for the autonym, i.e. the language name in the
language itself)

Since the lookup is not at all "cheap", but may
involve several eries of disk accesses, it would be good
to cache previous results, or eleminate redundant calls.
Comment 1 Sam Reed (reedy) 2011-03-19 19:54:31 UTC
Doing a array['language']['code'] = name would be a very cheap way of caching it on the fly.

Making a key like that, and storing in memcached wouldn't be difficult either, for a bit more persistant storage, which wouldn't be a bad idea...

wfMemcKey( 'babel', 'code', name );
Comment 2 Sam Reed (reedy) 2011-03-19 19:55:17 UTC
Probably should make getCode caching too
Comment 3 Niklas Laxström 2011-09-22 12:24:09 UTC
Purodha: it's been six months. Are you working on this?
Comment 4 Purodha Blissenbach 2011-10-04 14:27:54 UTC
No.
Comment 5 Siebrand Mazeland 2012-06-12 12:36:01 UTC
Update assignee and CCs
Comment 6 Ori Livneh 2012-06-28 06:07:18 UTC
Changelist 13297 adds memcached lookups.
Comment 7 Siebrand Mazeland 2012-06-28 06:35:09 UTC
(In reply to comment #6)
> Changelist 13297 adds memcached lookups.

That is Gerrit change #13297
Comment 8 Sam Reed (reedy) 2012-07-11 15:34:59 UTC
I've just created https://gerrit.wikimedia.org/r/15451 which adds numerous profilein/profileout calls to Babel

Can at least give some metrics to find out if we actually need to optimise anything, or if things are ok as they currently are..

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


Navigation
Links