From a3fb40dcded331e5dba77ae07c90e979c1142825 Mon Sep 17 00:00:00 2001 From: chaz6chez Date: Fri, 15 Sep 2023 11:30:11 +0800 Subject: [PATCH] update README.md --- tests/simple-benchmark.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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);