Skip to content

Instantly share code, notes, and snippets.

@mtymek
Last active August 29, 2015 14:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mtymek/660b388db0c5b9d63bc0 to your computer and use it in GitHub Desktop.
HeaderSecurity benchmark
<?php
include 'vendor/autoload.php';
$ts = microtime(true);
for ($i = 0; $i < 20000; $i++) {
$request = \Zend\Diactoros\ServerRequestFactory::fromGlobals();
}
$time = round(microtime(true) - $ts, 2);
echo "Test took {$time}s\n";
Test took 10.31s
Test took 10.37s
Test took 10.94s
Test took 10.96s
Test took 10.6s
Test took 6.26s
Test took 6.7s
Test took 6.29s
Test took 6.41s
Test took 6.36s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment