From 26ac06bdca59993b50f822ab569de5158474cc1c Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 27 Oct 2010 19:19:11 +0000 Subject: [PATCH] Compare latency between http and https by querying localhost. --- maintenance/benchmarks/bench_HTTP_HTTPS.php | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 maintenance/benchmarks/bench_HTTP_HTTPS.php 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 ); -- 2.20.1