r99922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99921‎ | r99922 | r99923 >
Date:22:30, 15 October 2011
Author:reedy
Status:ok (Comments)
Tags:lamecommitsummary 
Comment:
And 100
Modified paths:
  • /trunk/phase3/maintenance/benchmarks/benchmarkHooks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/benchmarks/benchmarkHooks.php
@@ -44,20 +44,33 @@
4545 }
4646 $time = $this->benchHooks();
4747 $this->output( 'Loaded (ten) hook: ' . $time . "\n" );
 48+
 49+ for( $i = 0; $i < 90; $i++ ) {
 50+ $wgHooks['Test'][] = array( $this, 'test' );
 51+ }
 52+ $time = $this->benchHooks();
 53+ $this->output( 'Loaded (ten) hook: ' . $time . "\n" );
4854 $this->output( "\n" );
4955 }
5056
51 - private function benchHooks( $trials = 1 ) {
 57+ /**
 58+ * @param $trials int
 59+ * @return string
 60+ */
 61+ private function benchHooks( $trials = 10 ) {
5262 $start = wfTime();
5363 for ( $i = 0; $i < $trials; $i++ ) {
5464 wfRunHooks( 'Test' );
5565 }
5666 $delta = wfTime() - $start;
5767 $pertrial = $delta / $trials;
58 - return sprintf( "Took %6.2fms",
 68+ return sprintf( "Took %6.2fs",
5969 $pertrial );
6070 }
6171
 72+ /**
 73+ * @return bool
 74+ */
6275 public function test() {
6376 return true;
6477 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99919Rudimentary hook benchmarksreedy22:15, 15 October 2011

Comments

#Comment by Krinkle (talk | contribs)   22:46, 17 October 2011

Follows up r99919, r99920

Status & tagging log