MDL-40585 backup: cache XML parent paths
commitf27cb59c36c81663f7b254d15b86ac4cbc3b06d6
authorRussell Smith <mr-russ@smith2001.net>
Thu, 11 Jul 2013 07:14:46 +0000 (11 17:14 +1000)
committerRussell Smith <mr-russ@smith2001.net>
Mon, 15 Jul 2013 05:07:35 +0000 (15 15:07 +1000)
tree6466ff05f14ab743c6c06ad6c5699eaa4a13107d
parentf8e6e5bc305535af966bd44ac01c554b327081fc
MDL-40585 backup: cache XML parent paths

For $this->groupedpaths, using a key is faster as there is
no need to do in_array searches.

Parent cache allows dirname calls to be substantially reduced.
2048 was chosen as a cache size as this class operates on chunks
of the restore at a time, 8k questions produces a parent cache of
about 500 paths and uses 300K of memory.  Scaling up to 2048 will
use about 1.2M of RAM for really large restores.  This is acceptable
for the 48% function call reduction and the 10% runtime improvement
seen.
backup/util/xml/parser/processors/grouped_parser_processor.class.php