maintenance/benchmarks/bench_HTTP_HTTPS.php 1 location
|
@@ 40-46 (lines=7) @@
|
37 |
|
$this->addDescription( 'Benchmark HTTP request vs HTTPS request.' ); |
38 |
|
} |
39 |
|
|
40 |
|
public function execute() { |
41 |
|
$this->bench( [ |
42 |
|
[ 'function' => [ $this, 'getHTTP' ] ], |
43 |
|
[ 'function' => [ $this, 'getHTTPS' ] ], |
44 |
|
] ); |
45 |
|
print $this->getFormattedResults(); |
46 |
|
} |
47 |
|
|
48 |
|
static function doRequest( $proto ) { |
49 |
|
Http::get( "$proto://localhost/", [], __METHOD__ ); |
maintenance/benchmarks/bench_if_switch.php 1 location
|
@@ 40-46 (lines=7) @@
|
37 |
|
$this->addDescription( 'Benchmark if elseif... versus switch case.' ); |
38 |
|
} |
39 |
|
|
40 |
|
public function execute() { |
41 |
|
$this->bench( [ |
42 |
|
[ 'function' => [ $this, 'doElseIf' ] ], |
43 |
|
[ 'function' => [ $this, 'doSwitch' ] ], |
44 |
|
] ); |
45 |
|
print $this->getFormattedResults(); |
46 |
|
} |
47 |
|
|
48 |
|
// bench function 1 |
49 |
|
function doElseIf() { |
maintenance/benchmarks/bench_wfIsWindows.php 1 location
|
@@ 40-46 (lines=7) @@
|
37 |
|
$this->addDescription( 'Benchmark for wfIsWindows.' ); |
38 |
|
} |
39 |
|
|
40 |
|
public function execute() { |
41 |
|
$this->bench( [ |
42 |
|
[ 'function' => [ $this, 'wfIsWindows' ] ], |
43 |
|
[ 'function' => [ $this, 'wfIsWindowsCached' ] ], |
44 |
|
] ); |
45 |
|
print $this->getFormattedResults(); |
46 |
|
} |
47 |
|
|
48 |
|
static function is_win() { |
49 |
|
return substr( php_uname(), 0, 7 ) == 'Windows'; |