Android HttpClient performance

后端 未结 2 1294
梦如初夏
梦如初夏 2021-02-02 02:44

I developing android app which uses a lot of http requests to web service. At first, I was creating a new HttpClient instance before every request. To increase performance I try

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 03:33

    I suspect the context switching is resulting in poor performance with the thread safe manager, and you should stop using it. I suppose you could compare the Apache client with the default Java client, but I don't think you are going to get much of a performance gain.

    Personally, I've found the DOM XML parser to be a bit slow, so if you are using XML reformatiing it may help. Depending on your app you may be able to request items before you need them or use caching to create a better user expierence, but we would need to know more to give you meaningful advice.

提交回复
热议问题