"Diethelm Guallar, Gonzalo" wrote:
> page. And, finally, he presented something that could be taken as a
> disadvantage of the templating model: he said JSP is a specification,
> not an implementation, and mentioned that with JSP you have the chance
> to change from one implementation to another if you find the
> particular implementation you are using does not meet your performance
> needs (he even gave Jasper as an example of a less than optimal
> implementation, in terms of performance). With templating languages
> (and he specifically mentioned Velocity as an example), if you find
> your performance needs are not satisfied, you are pretty much screwed,
> since there is no other alternative. After this question, I had to
> leave the BOF, since I had other things to do.
I was there too (standing up against the left-side wall...) I was going
to counter with the following, but figured it was his show :)
Jon's sensible arguments regarding Velocity as having a defined spec
notwithstanding, I will grant the spec-vs-impl issue to Craig for
argument sake. The problem I had with his spec vs implementation
argument is that it doesn't actually define *what* is specified.
By this I mean that there are no provisions for basic looping and logic
in the JSP spec, and once you toss out scriptlets due to danger ( <%
while(true) { Integer arr[] = new Integer[1000000]; } %> ), the
spec-compliant JSP is pretty useless. You can access beans, do
compile-time includes, and generate static content.
For logic and control, then have to resort to tag libraries, and there
are no official specs for that yet - so to make a useful page, you have
to use non-spec, implementation-only tag libraries, putting JSP squarely
in the box that he put Velocity into...
There is ongoing JSR work for a standard tag library that will provide
useful stuff like 'if', and the ever-popular, indispensable 'otherwise'
tag, but the current status of that work seems to require the use of
scriptlets again
<jsptl:if condition="<% [condition goes here] %>">
(or something like that)
as well as add tags for things like JDBC, XML-RPC and other I/O, etc, so
it will certainly be interesting to see what comes out.
>
> Question: do we have any numbers comparing the performance of a JSP
> page vs a Velocity page? This is a very broad question, but Craig's
> argument could be completely irrelevant if, on the average, Velocity
> pages are an order of magnitude faster than JSPs... Does anybody have
> such numbers handy?
I believe Vel won't be an order of magnitude faster, ever. At best,
there will be parity, I think, and right now, it is believed that Vel is
actually faster with a complicated page than what Tomcat's Jasper would
generate. However, I can easily live with parity or near parity, as I
think that the speed of development, ease of maintenance, and
flexibility in use is a real plus for Velocity (and WM...). And once
you saturate the output pipe, headroom is irrelevant anyway.
I hope to have some comparison examples up on the Velocity site very
soon.
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]