If I make two HTTP requests to the same URL, one with only HttpClient and the other with Volley, the Volley requests takes much longer.
For example, in my test environment:
here's a log dump of a sample Volley request:
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 much slower?
Looks like Volley is caching your response. Using HttpClient directly does not cache anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With