• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is Jsp faster than Servlets..??

 
rejieve alexander
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Could someone tell me why is jsp faster than a
servlet..for eg: when displaying an image ..
i can see the speed ,but why is it so..
the servlet is also compiled only once,right??
Plz clear it to me in a proper way..
Thanks
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rejieve alexander:
Could someone tell me why is jsp faster than a
servlet..

It isn't.
Since a JSP compiles to a servlet, it cannot be inherently faster, full stop. If your JSP is any faster than a similar servlet, there presumably is a difference in the coding techniques used.
- Peter
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your JSP is any faster than a similar servlet, there presumably is a difference in the coding techniques used.

Or, I should add, in the compiler. You might be using javac in your development environment and jikes in your server.
Whether that could give you any appreciable run-time performance difference, I don't know.
- Peter
 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jsp cannot be faster than a servlet...infact if the initial instantiation/loading of both are taken as a comparision then the servlet is faster than the jsp b'coz the jsp takes some more time in converting itself to the servlet the first time it is invoked befor the webserver loads the servlet and compiles it.

sagar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic