• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL + EL + Custom Tags performance vs Scriptlet performance

 
Suresh S Babu
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,

Which would be fastest. i am sure scriptlets will perform the fastest, but i was just wondering if anyone could tell me how much slower would JSTL + EL + Custom Tags perform in a typical application and if its worth not using them at all, and opting only for scriptlets (of course, at the cost of too much Java in a JSP).

Thanks.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe servlets can enhance the performance a bit but it would lead to a unmaintainable and less readable code . so its better to use JSTL+EL+custom tags wherever needed.

also a JSP should be used for presentation only . it should not include business logic in it.

avi sinha
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh S Babu wrote:i am sure scriptlets will perform the fastest ...

Without actual numbers from performance testing this assertion is flawed.
 
Suresh S Babu
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear, since EL would use Reflection (would it not?) to run the code, i have a very strong gut feel that it would run slower than direct Java programming through scriptlets. So, I was assuming that JSTL won't be so fast as direct scriptlet programming. In fact, that was the reason in one of my projects i have used scriptlets, where i was the only developer / designer.

Avi, thanks for your reply, but i was actually trying to compare scriptlets in JSP with JSTL + EL in JSP.
 
mark goking
Ranch Hand
Posts: 155
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have never had problems with jstl with regards to performance. and the code looks much cleaner if everything is coded in tags ;)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh S Babu wrote:since EL would use Reflection (would it not?) to run the code, i have a very strong gut feel that it would run slower than direct Java programming through scriptlets.

I'm glad you're not my doctor: "My gut feeling is that this steak knife will cut faster than a scalpel..."

In fact, that was the reason in one of my projects i have used scriptlets, where i was the only developer / designer.
Without any testing? Just on "gut"? Seriously?

Do you not think that perhaps there is similar, just different, overhead to processing scriptlets? For example, the syntax of scriptlets is much more complex than the simple XML-based JSTL. Did you measure the performance difference of that?

Do you use any other Java components in your web app? Do they most likely not use reflection as well? Did you use a database, which is where most "slowness" is introduced into an app?

Is any of that more than just noise in the face of network latency?

And even if there is a difference -- and there are too many variables for any "gut" to give you a valid answer -- is it even worth worrying about if it's so marginal that the end user is completely unaffected?

Put the steak knife away and pick up your scalpel...

 
Suresh S Babu
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Bear,

Liked your comments. :-) . Can say that i am a little more wiser now thanks to your comments!

Will surely run a test using JSTL and using scriptlets alone and then decide for myself.

In the meanwhile, i was interested in finding out about different people's findings about differences in performance between these two.

tks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic