Hi,
I just started using the Pipeline feature. Previously I evaluated performance of Pipeline for SET operation and it was quite amazing. So I decide to evaluate the performance of Pipeline in GET operation. To do this effectively, I want to understand the working of the Pipeline in GET operation. My code looks like this-
List<Response<String>> lstofresponse = new ArrayList<Response<String>>();
long loopstime = System.currentTimeMillis();
for ( int k = 0; k < n; k++)
{
Response<String> r = pipeline.get(k+instanceid);
lstofresponse.add(r);
}
long loopetime = System.currentTimeMillis();
pipeline.sync();
long execetime = System.currentTimeMillis();
long valloopstime = System.currentTimeMillis();
for(Response<String> r : lstofresponse)
{
String val = r.get();
}
long valloopetime = System.currentTimeMillis();
System.out.println("Loop Time = " + (loopetime - loopstime));
System.out.println("Execution Time = " + (execetime - loopetime));
System.out.println("Val loop time = " + (valloopetime - valloopstime));
Output-
Loop Time = 21091
Execution Time = 3431
Val loop time = 10040
Get 10000000 in Time : 34563
Now, my question is, when I get the actual values for my keys from Redis, when statement ' pipeline.sync(); ' is executed or when I actually iterate over the List of Response and I write response.get() (as done in the second loop) ?
Thanks in advance
Abhishek Patel