redis的pipeline测试分析
程序员文章站
2022-05-03 18:45:41
...
先上程序:
执行时间统计:
connect('127.0.0.1', 6379); $starttime = explode(" ",microtime()); $pipe = $redis->multi(Redis::PIPELINE); for ($i = 0; $i set("key::$i", str_pad($i, 4, '0', 0)); $pipe->get("key::$i"); } $replies = $pipe->exec(); //echo " "; print_r($replies); $endtime = explode(" ",microtime()); $thistime = $endtime[0]+$endtime[1]-($starttime[0]+$starttime[1]); $thistime = round($thistime,3); echo $thistime; echo "\r\n"; $a = array(); $starttime1 = explode(" ",microtime()); for($i= 0;$iset("key::$i", str_pad($i, 4, '0', 0)); } for($i=0;$iget("key::$i")); } //print_r($a); $endtime1 = explode(" ",microtime()); $thistime = $endtime1[0]+$endtime1[1]-($starttime1[0]+$starttime1[1]); $thistime = round($thistime,3); echo $thistime; echo "\r\n";
执行时间统计:
以上就介绍了 redis的pipeline测试分析,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
上一篇: 怎样用JS实现DOM树遍历