Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/213197
Change subject: Process cache tagUsageStatistics() to improve performance
......................................................................
Process cache tagUsageStatistics() to improve performance
Change-Id: I4a95c00d84c216ad08f30f0971877dfb728f86ff
---
M includes/changetags/ChangeTags.php
1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/97/213197/1
diff --git a/includes/changetags/ChangeTags.php
b/includes/changetags/ChangeTags.php
index a730116..79763bd 100644
--- a/includes/changetags/ChangeTags.php
+++ b/includes/changetags/ChangeTags.php
@@ -1177,9 +1177,15 @@
* @return array Array of string => int
*/
public static function tagUsageStatistics() {
- $fname = __METHOD__;
+ static $cachedStats = null;
- return ObjectCache::getMainWANInstance()->getWithSetCallback(
+ // Process cache to avoid I/O and repeated regens during holdoff
+ if ( $cachedStats !== null ) {
+ return $cachedStats;
+ }
+
+ $fname = __METHOD__;
+ $cachedStats =
ObjectCache::getMainWANInstance()->getWithSetCallback(
wfMemcKey( 'change-tag-statistics' ),
function() use ( $fname ) {
$out = array();
@@ -1209,6 +1215,8 @@
array( wfMemcKey( 'change-tag-statistics' ) ),
array( 'lockTSE' => INF )
);
+
+ return $cachedStats;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/213197
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a95c00d84c216ad08f30f0971877dfb728f86ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits