Restrict empty-frame cache entries to their parent
authorJackmcbarn <jackmcbarn@gmail.com>
Thu, 29 May 2014 00:54:55 +0000 (20:54 -0400)
committerGWicke <gwicke@wikimedia.org>
Fri, 30 May 2014 01:38:15 +0000 (01:38 +0000)
commit2094e578b4ff0fdf6df351c44727b4e23846ac85
tree36bfcb0946c4257f258f459b7ad4eb86e5db300b
parentc888520e9921225b92af101f21ae3462530e3e35
Restrict empty-frame cache entries to their parent

Remove the parser's global $mTplExpandCache, and replace it with an
alternative that is separated by parent frame. This allows the integrity
of the empty-frame expansion cache to be maintained while also allowing
parent frame access.

A page with 3 copies of
http://ja.wikipedia.org/wiki/%E4%B8%AD%E5%A4%AE%E7%B7%9A_(%E9%9F%93%E5%9B%BD)
has the following statistics: Without this change, there are 4625 cache hits
on this page, and a sample of 3 parses took 16.6, 16.9, and 16.8 seconds.
With this change, there are 2588 cache hits, and a sample of 3 parses took
16.7, 16.7, and 17.0 seconds.

Change-Id: I621e9075e0f136ac188a4d2f53418b7cc957408d
includes/parser/Parser.php
includes/parser/Preprocessor.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php