Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Use files for mediawiki localisation cache
Browse files Browse the repository at this point in the history
- a mysql query per localisable string is just insane
- 23% performance improvement on HHVM master
- should help all runtimes
  • Loading branch information
fredemmott committed May 18, 2015
1 parent 7bf2918 commit abc1875
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions targets/mediawiki/MediaWikiTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ public function install(): void {
->setDatabaseName('mw_bench')
->setDumpFile(__DIR__.'/mw_bench.sql.gz')
->installDatabase();

$cache_dir = $this->options->tempDir.'/mw-cache';
mkdir($cache_dir);

file_put_contents(
$this->getSourceRoot().'/LocalSettings.php',
'$wgLocalisationCacheConf["store"] = "file";'.
'$wgCacheDirectory="'.$cache_dir.'";',
FILE_APPEND
);
}

public function getSourceRoot(): string {
Expand Down

0 comments on commit abc1875

Please sign in to comment.