Relative Content

Tag Archive for javamultithreadingparallel-processingexecutorservice

Not getting expected latency using ExecutorService in Java

I have a usecase where I have to call one method 13 times. This method is in turn making 2 api calls and since we cannot change the structure of this method , therefore calling that method as it is. For individual method call , it is taking 11-12 sec. While executing these 13 method calls sequentially, it is giving result in 2.3 min(approx).I am trying to making parallel calls, using executerService in java, to this method, but getting output in 1.8 – 2.0 minutes. Which is not expected. I want the output within 20 sec.(as we are already able to get individual call’s output in 11 sec).