dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3298bb2
)
Make Sites::singleton() actually return a singleton.
author
daniel
<daniel.kinzler@wikimedia.de>
Thu, 31 Jan 2013 14:33:22 +0000
(15:33 +0100)
committer
daniel
<daniel.kinzler@wikimedia.de>
Thu, 31 Jan 2013 14:33:22 +0000
(15:33 +0100)
Sites::singleton() was returning a new instance for every call,
rendering in-process caching ineffective. This was causing extreme
slowness on some configurations (about factor 100).
Change-Id: I1e28afea8710b44542c55db150ad37518a5a5df1
includes/site/SiteSQLStore.php
patch
|
blob
|
history
diff --git
a/includes/site/SiteSQLStore.php
b/includes/site/SiteSQLStore.php
index
a79c8c5
..
c462057
100644
(file)
--- a/
includes/site/SiteSQLStore.php
+++ b/
includes/site/SiteSQLStore.php
@@
-466,7
+466,13
@@
class Sites extends SiteSQLStore {
* @return SiteStore
*/
public static function singleton() {
- return new static();
+ static $singleton;
+
+ if ( $singleton === null ) {
+ $singleton = new static();
+ }
+
+ return $singleton;
}
/**