I noticed that sometimes my application is very slow, so I did some tests. This is a very simple web application. One servlet receives some parameters, than saves them. Everything is fine, except for one. Getting the parameter for the first time takes too much time. It doesn't matter which parameter I'm trying to get, but the first time it is very slow. The strange thing is not always. Sometimes getting a parameter for the first time does not slow down.
My code is as follows
request.getParameter("paramName");
request.getParameter("paramName2");
request.getParameter("paramName3");
Getting "paramName" is slow. Getting others is very fast.
Slowly I mean: 200-800 milliseconds Very fast I mean: ~ 0 milliseconds (in the code snippet I did not write a performance test, but I use System.currentTimeMillis())
UPDATE
I exported my project to a .WAR file and deployed it to Tomcat. Everything is fine. Therefore, I think this problem is related to Eclipse or something.
source
share