Add LCStore implementation that uses static arrays in PHP files
authorFred Emmott <fe@fb.com>
Tue, 9 Jun 2015 21:24:15 +0000 (14:24 -0700)
committerOri.livneh <ori@wikimedia.org>
Thu, 11 Jun 2015 18:14:51 +0000 (18:14 +0000)
commitc403d4838dc8662d62902ced3713c1d9be6309cc
tree2246a36da13bc8c580fdfbd2d995601614d7657a
parent9aaf07951276b9169440fa229f6be23a025b2da3
Add LCStore implementation that uses static arrays in PHP files

Implementation written by Fred Emmott of Facebook. Quoting Fred:

As well as array access being faster, the main advantage is actually
that this significantly reduces the use of unserialize(), which does a
lot of memcpys when making the strings.

Benchmarks compared to LCStoreCDB:
* HHVM (no repo-auth): ~7% improvement
* HHVM (with repo-auth): ~12% improvement
* PHP7: ~1% improvement

My (Legoktm) brief testing noted that the generated PHP files were
noticiably larger than the CDB ones:
* 1.5M en.l10n.php
* 932K l10n_cache-en.cdb

Bug: T99740
Change-Id: Ib2c5856d40cd928cab4a79cb935b3ce08c598300
autoload.php
includes/DefaultSettings.php
includes/cache/LCStoreStaticArray.php [new file with mode: 0644]
includes/cache/LocalisationCache.php