-
-
Save muayyad-alsadi/44379c3c5dc58a1a033e to your computer and use it in GitHub Desktop.
benchmarking two YiiRedis against PRedis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CacheCommand extends CConsoleCommand | |
{ | |
public function actionBenchmark() { | |
$t0=microtime(1); | |
for($i=0;$i<10000;++$i) { | |
Yii::app()->redis->getClient()->set("mykey1", "10"); | |
} | |
$delta=microtime(1)-$t0; | |
echo "YiiRedis delta $delta\n"; | |
$t0=microtime(1); | |
for($i=0;$i<10000;++$i) { | |
Yii::app()->redis2->set('mykey2', "10"); | |
} | |
$delta=microtime(1)-$t0; | |
echo "Predis delta $delta\n"; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment