Last modified: 2012-08-01 19:56:24 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.
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 );
Probably should make getCode caching too
Purodha: it's been six months. Are you working on this?
No.
Update assignee and CCs
Changelist 13297 adds memcached lookups.
(In reply to comment #6) > Changelist 13297 adds memcached lookups. That is Gerrit change #13297
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..