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:
81f8704
)
Move the overhead computation to another function.
author
Platonides
<platonides@users.mediawiki.org>
Thu, 10 Feb 2011 16:54:51 +0000
(16:54 +0000)
committer
Platonides
<platonides@users.mediawiki.org>
Thu, 10 Feb 2011 16:54:51 +0000
(16:54 +0000)
includes/Profiler.php
patch
|
blob
|
history
diff --git
a/includes/Profiler.php
b/includes/Profiler.php
index
6deb742
..
551ce23
100644
(file)
--- a/
includes/Profiler.php
+++ b/
includes/Profiler.php
@@
-263,12
+263,7
@@
class Profiler {
# Estimate profiling overhead
$profileCount = count($this->mStack);
# Estimate profiling overhead
$profileCount = count($this->mStack);
- wfProfileIn( '-overhead-total' );
- for( $i = 0; $i < $profileCount; $i ++ ){
- wfProfileIn( '-overhead-internal' );
- wfProfileOut( '-overhead-internal' );
- }
- wfProfileOut( '-overhead-total' );
+ self::calculateOverhead( $profileCount );
# First, subtract the overhead!
$overheadTotal = $overheadMemory = $overheadInternal = array();
# First, subtract the overhead!
$overheadTotal = $overheadMemory = $overheadInternal = array();
@@
-347,6
+342,18
@@
class Profiler {
return $prof;
}
return $prof;
}
+ /**
+ * Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead
+ */
+ protected static function calculateOverhead( $profileCount ) {
+ wfProfileIn( '-overhead-total' );
+ for( $i = 0; $i < $profileCount; $i++ ){
+ wfProfileIn( '-overhead-internal' );
+ wfProfileOut( '-overhead-internal' );
+ }
+ wfProfileOut( '-overhead-total' );
+ }
+
/**
* Counts the number of profiled function calls sitting under
* the given point in the call graph. Not the most efficient algo.
/**
* Counts the number of profiled function calls sitting under
* the given point in the call graph. Not the most efficient algo.