开发者

Performance difference between synchronous and AJAX calls

I have a normal HTTP request (no Ajax) and I return a response from server side. This takes around 350ms. The same response when returned through an Ajax call takes only 50 ms.

I checked also the processing or the time taken to prepare the response on the server side. This time is the same for both the requests. (For example, in both cases MyServlet handles the request开发者_JAVA百科 and returns the response. I gave sysout in the doPost method and the time spent inside the Servlet is the same).


I hope you are aware, that AJAX is asynchronous? Could it be that you are measuring the time the call returns (should return immediately) and not until an actual response is received (onSuccess event called)?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜