Created
July 5, 2016 14:03
-
-
Save consatan/ccb69768e2b4619801bc8d0a4edda395 to your computer and use it in GitHub Desktop.
Redis 插入100万数据到 List
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 | |
$time = microtime(true); | |
ini_set('memory_limit', -1); | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1', 6379); | |
$arr = range(1, 1000000); | |
array_unshift($arr, 'test'); | |
$redis->delete('test'); | |
$redis->multi(Redis::PIPELINE); | |
call_user_func_array([$redis, 'rpush'], $arr); | |
$redis->exec(); | |
var_dump((microtime(true) - $time) * 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment