From: Sam Reed Date: Sat, 15 Oct 2011 22:30:23 +0000 (+0000) Subject: And 100 X-Git-Tag: 1.31.0-rc.0~27083 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=e4f7b10e96e66297ea6860bd39e9bf372e065a56;p=lhc%2Fweb%2Fwiklou.git And 100 --- diff --git a/maintenance/benchmarks/benchmarkHooks.php b/maintenance/benchmarks/benchmarkHooks.php index 59466d07ff..90e5908b87 100644 --- a/maintenance/benchmarks/benchmarkHooks.php +++ b/maintenance/benchmarks/benchmarkHooks.php @@ -44,20 +44,33 @@ class BenchmarkHooks extends Benchmarker { } $time = $this->benchHooks(); $this->output( 'Loaded (ten) hook: ' . $time . "\n" ); + + for( $i = 0; $i < 90; $i++ ) { + $wgHooks['Test'][] = array( $this, 'test' ); + } + $time = $this->benchHooks(); + $this->output( 'Loaded (ten) hook: ' . $time . "\n" ); $this->output( "\n" ); } - private function benchHooks( $trials = 1 ) { + /** + * @param $trials int + * @return string + */ + private function benchHooks( $trials = 10 ) { $start = wfTime(); for ( $i = 0; $i < $trials; $i++ ) { wfRunHooks( 'Test' ); } $delta = wfTime() - $start; $pertrial = $delta / $trials; - return sprintf( "Took %6.2fms", + return sprintf( "Took %6.2fs", $pertrial ); } + /** + * @return bool + */ public function test() { return true; }