wmde/WikibaseDataModel — pull request #266 by filbertkm (2014-11-01 20:46:23+00:00)
Title: Don't use array_merge in getAllSnaks methods

It is unnecessary and more costly, performance-wise. array_merge consumes the most memory of any method used throughout the data model, Wikibase, and MediaWiki.

Avoiding array_merge here also helps improve the time it takes to load an item in Wikibase.

In a medium-size item, with array_merge:

* Entity::getAllSnaks - called 2 times, takes 109 ms
* Claim::getAllSnaks - called 846 times, takes 188 ms
* Statement::getAllSnaks - called 846 times, takes 148 ms

Without array_merge, on the same item:

* Entity::getAllSnaks - 22 ms
* Claim::getAllSnaks - 63 ms
* Statement::getAllSnaks - 66 ms

StatementList::getAllSnaks appears unused.