From: Brion Vibber Date: Sat, 27 Nov 2004 02:45:36 +0000 (+0000) Subject: Reduce total profiling overhead by about 6%, and internal overhead by about 40% X-Git-Tag: 1.5.0alpha1~1224 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=5a70d6951e0f94faf3f0f5f76b8b44d35e306045;p=lhc%2Fweb%2Fwiklou.git Reduce total profiling overhead by about 6%, and internal overhead by about 40% --- 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; } }