java - Increase the performance of this code -


is there way increase performance of following for loops:

for(string s : lista){    for(string s1 : listb){       for(string s2 : listc){           //api call       }    } } 

i doing api call in inner loop. each time has call api , causing performance issue. there simple way can achieve without performance issue of using libraries?

instead of calling api in loop, try instead adding details of necessary api call queue. use multiple threads process queue.

obviously same total time taken, loop should complete earlier. remember loop completing no longer mean api calls done.


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -