| Author |
JSTL + EL + Custom Tags performance vs Scriptlet performance
|
Suresh S Babu
Greenhorn
Joined: Apr 23, 2009
Posts: 5
|
|
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
Joined: Mar 15, 2009
Posts: 452
|
|
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
|
SCJP 5.0 SCWCD 5.0
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
Suresh S Babu wrote:i am sure scriptlets will perform the fastest ...
Without actual numbers from performance testing this assertion is flawed.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Suresh S Babu
Greenhorn
Joined: Apr 23, 2009
Posts: 5
|
|
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
Joined: Aug 18, 2009
Posts: 155
|
|
|
i have never had problems with jstl with regards to performance. and the code looks much cleaner if everything is coded in tags ;)
|
Website/Java Games: http://www.chitgoks.com
Tech Blog: http://tech.chitgoks.com
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
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
Joined: Apr 23, 2009
Posts: 5
|
|
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.
|
 |
 |
|
|
subject: JSTL + EL + Custom Tags performance vs Scriptlet performance
|
|
|