• Post Reply Bookmark Topic Watch Topic
  • New Topic

Long loading time. Why?  RSS feed

 
Apple Khoa
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I have written the following code in my Servlet, but the time taken by the web page (with localhost) to generate the output takes more than 4 minutes. I am not sure if it is due to my code, hence I am posting my code here to check it out.



If my code is the root of the long loading time, could anyone kindly advise me how I could improve the code?
(By the way, base3LHS and base3RHS cannot be grouped together though they are identical because the terms are supposed to represent different parameters in the doc.add statement)

Otherwise, I would appreciate if anyone could suggest what could be the possible reasons behind the long loading time.

Thanks in advance.
 
James E Baker
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's anything in the code you posted causing any delays. It's pretty basic stuff... just random number generating and switch statements. The only part that I am not sure about is the "doc.add" statement but I doubt that would do it either.

You could always //comment out parts (or all) of the code and then test your servlet.
 
Apple Khoa
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James E Baker wrote:I don't think there's anything in the code you posted causing any delays. It's pretty basic stuff... just random number generating and switch statements. The only part that I am not sure about is the "doc.add" statement but I doubt that would do it either.

You could always //comment out parts (or all) of the code and then test your servlet.


Thanks, James E Baker. I adopted your advice and //comment out parts of the code to find out what's going wrong. Indeed, it helps!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!