Closed ra1u closed 9 years ago
ok interesting, thx.
import "package:redis_client/redis_client.dart";
const int N = 10000;
void test1(RedisClient client){
void recursive_loop(RedisClient client,int n){
if(n<0){
print("done");
return;
}
if(n%(N/100) == 0){
print("$n");
}
client.set("test $n", "$n")
.then((_) => client.get("test $n")
.then((value){
recursive_loop(client,n-1);
}
));
}
recursive_loop(client,N);
}
main() {
var connectionString = "localhost:6379";
RedisClient.connect(connectionString)
.then(test1);
}
By default, it is Nagle's algo enabled for socket. http://en.wikipedia.org/wiki/Nagle%27s_algorithm I haven measured exactly speedup seems to be like 10 times.