From 5a70d6951e0f94faf3f0f5f76b8b44d35e306045 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 27 Nov 2004 02:45:36 +0000 Subject: [PATCH] Reduce total profiling overhead by about 6%, and internal overhead by about 40% --- includes/Profiling.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/Profiling.php b/includes/Profiling.php index 0b252a2de3..8eb6017714 100755 --- a/includes/Profiling.php +++ b/includes/Profiling.php @@ -59,10 +59,11 @@ class Profiler if ( $wgDebugFunctionEntry && function_exists( 'wfDebug' ) ) { wfDebug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering '.$functionname."\n" ); } - array_push( $this->mWorkStack, array($functionname, count( $this->mWorkStack ), microtime(), memory_get_usage() ) ); + $this->mWorkStack[] = array($functionname, count( $this->mWorkStack ), microtime(), memory_get_usage() ); } function profileOut( $functionname ) { + $time = microtime(); $memory = memory_get_usage(); global $wgDebugProfiling, $wgDebugFunctionEntry; @@ -82,9 +83,9 @@ class Profiler wfDebug( "Profiling error: in({$bit[0]}), out($functionname)\n" ); } } - array_push( $bit, microtime() ); - array_push( $bit, $memory ); - array_push( $this->mStack, $bit ); + $bit[] = $time; + $bit[] = $memory; + $this->mStack[] = $bit; } } -- 2.20.1