Volleyball: Slow HTTP Requests

If I make two HTTP requests to the same URL, one with HttpClient and the other with Volley, Volley requests take much longer.

For example, in my test environment:

  • using HttpClient to request google.com averages of around 250 ms
  • using Volley to query google.com averages about 750 ms

here is the Volley request sample log dump:

11:44:14.766: D/Volley(863): [1] MarkerLog.finish: (773 ms) [ ] http://google.com 0xa46e044c NORMAL 1 11:44:14.766: D/Volley(863): [1] MarkerLog.finish: (+0 ) [ 1] add-to-queue 11:44:14.786: D/Volley(863): [1] MarkerLog.finish: (+0 ) [93] cache-queue-take 11:44:14.786: D/Volley(863): [1] MarkerLog.finish: (+7 ) [93] cache-hit-expired 11:44:14.796: D/Volley(863): [1] MarkerLog.finish: (+1 ) [97] network-queue-take 11:44:14.806: D/Volley(863): [1] MarkerLog.finish: (+722 ) [97] network-http-complete 11:44:14.806: D/Volley(863): [1] MarkerLog.finish: (+20 ) [97] network-parse-complete 11:44:14.816: D/Volley(863): [1] MarkerLog.finish: (+16 ) [97] network-cache-written 11:44:14.826: D/Volley(863): [1] MarkerLog.finish: (+0 ) [97] post-response 11:44:14.836: D/Volley(863): [1] MarkerLog.finish: (+7 ) [ 1] done 

as you can see, the bottleneck is in the actual http request. Why is it so slow?

+6
source share
1 answer

Volleyball seems to be caching your answer. Using HttpClient does not cache anything directly.

+1
source

Source: https://habr.com/ru/post/946808/


All Articles