diff --git a/tests/simple-benchmark.php b/tests/simple-benchmark.php index 86b0e33..58b0cd7 100644 --- a/tests/simple-benchmark.php +++ b/tests/simple-benchmark.php @@ -8,6 +8,25 @@ $count = 10000; +$interval = 0; +dump("count: $count", "interval: $interval μs"); +$start = microtime(true); +for ($i = 0; $i < 10000; $i ++) { + $redis->set('test-redis', $i); + usleep($interval); +} +dump('redis: ' . microtime(true) - $start); +$redis->del('test-redis'); + +$start = microtime(true); +for ($i = 0; $i < $count; $i ++) { + \Workbunny\WebmanSharedCache\Cache::Set('test-cache', $i); + usleep($interval); +} +dump('cache: ' . microtime(true) - $start); +\Workbunny\WebmanSharedCache\Cache::Del('test-cache'); +dump('-----------------------------------'); + $interval = 1; dump("count: $count", "interval: $interval μs"); $start = microtime(true);