Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Sep 15, 2023
1 parent 194970c commit 8876064
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/simple-benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$redis = new Redis();
$redis->pconnect('host.docker.internal');

$count = 10000;
$count = 100000;

$interval = 0;
dump("count: $count", "interval: $interval μs");
Expand All @@ -19,7 +19,6 @@
$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');
Expand All @@ -28,7 +27,7 @@
$interval = 1;
dump("count: $count", "interval: $interval μs");
$start = microtime(true);
for ($i = 0; $i < 10000; $i ++) {
for ($i = 0; $i < $count; $i ++) {
$redis->set('test-redis', $i);
usleep($interval);
}
Expand All @@ -47,7 +46,7 @@
$interval = 10;
dump("count: $count", "interval: $interval μs");
$start = microtime(true);
for ($i = 0; $i < 10000; $i ++) {
for ($i = 0; $i < $count; $i ++) {
$redis->set('test-redis', $i);
usleep($interval);
}
Expand All @@ -67,7 +66,7 @@
$interval = 100;
dump("count: $count", "interval: $interval μs");
$start = microtime(true);
for ($i = 0; $i < 10000; $i ++) {
for ($i = 0; $i < $count; $i ++) {
$redis->set('test-redis', $i);
usleep($interval);
}
Expand All @@ -87,7 +86,7 @@
$interval = 1000;
dump("count: $count", "interval: $interval μs");
$start = microtime(true);
for ($i = 0; $i < 10000; $i ++) {
for ($i = 0; $i < $count; $i ++) {
$redis->set('test-redis', $i);
usleep($interval);
}
Expand All @@ -101,4 +100,4 @@
}
dump('cache: ' . microtime(true) - $start);
\Workbunny\WebmanSharedCache\Cache::Del('test-cache');
dump('-----------------------------------');
dump('-----------------------------------');

0 comments on commit 8876064

Please sign in to comment.