From: Antoine Musso Date: Wed, 27 Oct 2010 19:19:11 +0000 (+0000) Subject: Compare latency between http and https by querying localhost. X-Git-Tag: 1.31.0-rc.0~34259 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=26ac06bdca59993b50f822ab569de5158474cc1c;p=lhc%2Fweb%2Fwiklou.git Compare latency between http and https by querying localhost. --- diff --git a/maintenance/benchmarks/bench_HTTP_HTTPS.php b/maintenance/benchmarks/bench_HTTP_HTTPS.php new file mode 100644 index 0000000000..558b45b7d5 --- /dev/null +++ b/maintenance/benchmarks/bench_HTTP_HTTPS.php @@ -0,0 +1,38 @@ +bench( array( + array( 'function' => array( $this, 'getHTTP' ) ), + array( 'function' => array( $this, 'getHTTPS' ) ), + )); + print $this->getFormattedResults(); + } + + static function doRequest( $proto ) { + Http::get( "$proto://localhost/" ); + } + + // bench function 1 + function getHTTP() { + $this->doRequest( 'http' ); + } + + // bench function 2 + function getHTTPS() { + $this->doRequest( 'https' ); + } +} + +$maintClass = 'bench_HTTP_HTTPS'; +require_once( DO_MAINTENANCE );