优化排球

我正在使用Google IO 2013中引入的Volley。我在浏览器中运行相同的URL,并在不到一秒的时间内返回。 我想知道如何优化Volley。 不清楚Cache Queue Take代表什么,为什么是3.6秒。 或为什么需要caching队列和networking完成的响应时间是6.8秒? 我应该如何优化不使用ETags的服务。 什么是BasicNetwork.logSlowRequests?

谢谢

07-26 09:52:31.395: D/Volley(5651): [4378] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] http://theurl.com/path 0xd6183ced NORMAL 6> [lifetime=3172], [size=940], [rc=200], [retryCount=0] 07-26 09:52:31.400: D/Volley(5651): [4377] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] http://theurl.com/path 0xd6183ced NORMAL 5> [lifetime=3182], [size=940], [rc=200], [retryCount=0] 07-26 09:52:31.445: D/Volley(5651): [1] MarkerLog.finish: (6848 ms) [ ] http://theurl.com/path 0xd6183ced NORMAL 6 07-26 09:52:31.445: D/Volley(5651): [1] MarkerLog.finish: (+0 ) [ 1] add-to-queue 07-26 09:52:31.445: D/Volley(5651): [1] MarkerLog.finish: (+3622) [4376] cache-queue-take 07-26 09:52:31.450: D/Volley(5651): [1] MarkerLog.finish: (+6 ) [4376] cache-hit-expired 07-26 09:52:31.450: D/Volley(5651): [1] MarkerLog.finish: (+0 ) [4378] network-queue-take 07-26 09:52:31.450: D/Volley(5651): [1] MarkerLog.finish: (+3173) [4378] network-http-complete 07-26 09:52:31.450: D/Volley(5651): [1] MarkerLog.finish: (+36 ) [4378] network-parse-complete 07-26 09:52:31.450: D/Volley(5651): [1] MarkerLog.finish: (+11 ) [4378] network-cache-written 07-26 09:52:31.450: D/Volley(5651): [1] MarkerLog.finish: (+0 ) [4378] post-response 07-26 09:52:31.455: D/Volley(5651): [1] MarkerLog.finish: (+0 ) [ 1] done 07-26 09:52:31.455: D/ 07-26 09:52:31.525: D/Volley(5651): [1] MarkerLog.finish: (6998 ms) [ ] http://myurl 0xd6183ced NORMAL 5 07-26 09:52:31.525: D/Volley(5651): [1] MarkerLog.finish: (+0 ) [ 1] add-to-queue 07-26 09:52:31.530: D/Volley(5651): [1] MarkerLog.finish: (+3683) [4376] cache-queue-take 07-26 09:52:31.530: D/Volley(5651): [1] MarkerLog.finish: (+7 ) [4376] cache-hit-expired 07-26 09:52:31.530: D/Volley(5651): [1] MarkerLog.finish: (+1 ) [4377] network-queue-take 07-26 09:52:31.530: D/Volley(5651): [1] MarkerLog.finish: (+3184) [4377] network-http-complete 07-26 09:52:31.535: D/Volley(5651): [1] MarkerLog.finish: (+39 ) [4377] network-parse-complete 07-26 09:52:31.535: D/Volley(5651): [1] MarkerLog.finish: (+21 ) [4377] network-cache-written 07-26 09:52:31.535: D/Volley(5651): [1] MarkerLog.finish: (+0 ) [4377] post-response 07-26 09:52:31.535: D/Volley(5651): [1] MarkerLog.finish: (+63 ) [ 1] done 

Solutions Collecting From Web of "优化排球"

我只是在这里回答了这个问题: 如何优化在android Volley中的networking队列? (Volley Google IO 2013)

logSlowRequests只logging缓慢(超过3000毫秒)的请求,没有更复杂的那里。 networkinghttp-complete是下载请求并将其传递给parsing器需要多长时间。

尝试使用这种增强排球

该项目基于由Google自己创build的适用于Android的Volleynetworking工具包。 该工具包本身非常好,可扩展,但缺less一些function。 该项目旨在将这些function添加到Volley工具包中,使其成为更完整的HTTP解决scheme。

您也可以使用Java NIO(新IO)来定制库,以提高callback/响应时间。 使用Socket.IO

有些人也试图用OKHTTP排球

感谢维纳先生