redis string hash 测试
//$num = 30*200; $num = 50000; $stratTime = microtime(true); $startMemory = memory_get_usage(); for($i=0;$i<$num;$i++){ $array = array( 'zero'=>'resty'.$i,'one'=>'onetht'.$i,'two'=>'this is test'.$i,'three'=>3+$i,'four'=>4); $arrayString = json_encode($array); $this->redis->set('onetest'.$i,$arrayString); $getRedis = $this->redis->get('onetest'.$i); $tmp = json_decode($getRedis,true); } $endTime = microtime(true); $runtime = ($endTime - $stratTime) * 1000; //将时间转换为毫秒 $endMemory = memory_get_usage(); $usedMemory = ($endMemory - $startMemory) / 1024; echo "运行时间: {$runtime} 毫秒<br />"; echo "耗费内存: