• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is it faster?

 
Peter Allen
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a question that I was wondering about. I remember reading that Servlets have a speed advantage over JSP. Why is this the case, shouldn't it be about the same? What's causes JSP to load slower? Any answers would help, thanks.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would believe they are faster for the first time acess comparision only. When a JSP is accessed the first time, unless it is pre-compiled, it takes time to be converted into a servlet. Then it is loaded.
I don't think there is a significant performance hit after that, although I must admit I have never stress tested them.
regds.
- madhav
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah i agree with madhav that since the first time a request is send to a jsp it is compiled to a servelet before processing the request, henchforth I don't see any reason why a servlet should be faster vis a vis a jsp...may be this could across various servers but faster...I doubt
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The extra steps that a servlet engine takes to set up a JSP servlet are tiny compared to normal processing times, so I doubt if you could detect a difference.
Bill
 
Naveen Sydney
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam not sure where u read that servlets are faster than JSP's. i agree with others, jsp's are compiled the first time they are accessed, after that it should be the same.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this thread for more information on this topic.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!