英文:
How to optimize the isHealthy() method in OkHttp when the doExtensiveCheck parameter is set to true?
问题
我们在Java项目中使用okhttp3.14.9来发送HTTP请求,发现使用PUT/POST方法大约需要20毫秒,而GET方法只需要2毫秒,两者的请求主体都为空。有人能帮忙吗?
我发现根本原因是doExtensiveCheck参数,那么如何优化这个?
英文:
We ues okhttp3.14.9 to send http requests in java project,and we found that put/post method took about 20ms while get just took 2ms,both requestbody is empty,anyone can help?
I found the root cause is the doExtensiveCheck parameter,so how to optimize this?
答案1
得分: 1
升级您的 OkHttp。此方法在 OkHttp 4.x 中进行了优化,不再存在这个性能问题。
英文:
Upgrade your OkHttp. This method is optimized in OkHttp 4.x and doesn’t have this performance problem.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论