First on the program:
"!--? Php$redis = new Redis (); $redis--->connect (' 127.0.0.1 ', 6379); $starttime = Explode ("", Microtime ()); $pipe = $redis->multi (redis::P ipeline) ; for ($i = 0; $i < 10000; $i + +) {$pipe->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 (); $starttime 1 = Explode ("", Microtime ()); for ($i = 0; $i <10000; $i + +) {$redis->set ("Key:: $i", Str_pad ($i, 4, ' 0 ', 0));} for ($i =0; $i <10000; $i + +) {Array_push ($a, $redis->get ("Key:: $i"));} Print_r ($a); $endtime 1 = Explode ("", Microtime ()); $thistime = $endtime 1[0]+ $endtime 1[1]-($starttime 1[0]+$ STARTTIME1[1]); $thistime = Round ($thistime, 3); echo $thistime; echo "\ r \ n";
Execution Time Statistics:
The above describes the Redis pipeline test analysis, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.