You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Rickard Öberg <ri...@xpedio.com> on 2001/08/07 16:03:57 UTC

Velocity and WebWork: speed speed and more speed

Hey Velociteers and WebWorkers,

Alright, I've mucked around with Velocity all day now, and, well, it's
going very very well. :-)))
I've learned quite a bit about the inner workings and how to tweak
things.

I have now added a couple of WebWork macro's (loaded automagically as a
library, and bundled in webwork.jar for simplicity) to access some
WebWork functionality such as instantiating actions and beans.

The monthlist.vm test page has been updated, and I've attached it to
this email so you can see what it looks like, and also the macro
definition template. Setting parameters of beans is still not working
properly, and I don't know why, but it works with the $foo.setProp(..)
format anyway.

Ok, and now here's the good part:
running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.

Read again if you wish :-)

30ms. Consider that the exact same page in JSP-format takes about 250ms
on Catalina and about 150ms on Orion. (and yes I did hundreds of reloads
to ensure that the timings are stable)

Wow. Neat. Kewl.

Still not sure just what the heck it means. Is the taglib fucked up, or
is our expression evaluator too slow, or what? Or is it simply the case
that Velocity is pretty darn snappy.

Any ideas, comments, thoughts?

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by Incze Lajos <in...@mail.matav.hu>.
On the other hand (it should be some miracle) I've GOT actually
your attachement at the 1st time, so don't understand the the
followups. Anyway: I copy/pasted it here:

--
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com
[-- Attachment #2: webwork.vm --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.2K --]
 
#macro(action $action_name $name)
   #set ($name = $webwork.action($action_name))
#end
 
#macro(execute $name)
  #set ($result = $name.execute())
#end
 
#macro(bean $bean_name $name)
   #set ($name = $webwork.bean($bean_name))
#end

Re: Velocity and WebWork: speed speed and more speed

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/7/01 8:28 AM, "Rickard Öberg" <ri...@xpedio.com> wrote:

> Hm.. seems like velocity-* strips away attachments.

No. It only strips away certain attachments (ie: HTML).

For example, Attila posted a few .zip files recently and it came through
just fine.

thanks,

-jon


Re: Velocity and WebWork: speed speed and more speed

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/7/01 8:28 AM, "Rickard Öberg" <ri...@xpedio.com> wrote:

> Hm.. seems like velocity-* strips away attachments.

No. It only strips away certain attachments (ie: HTML).

For example, Attila posted a few .zip files recently and it came through
just fine.

thanks,

-jon


Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
Rickard Öberg wrote:
> Rickard Öberg wrote:
> > The monthlist.vm test page has been updated, and I've attached it to
> > this email so you can see what it looks like,
> 
> .. which I didn't do... sigh.. attached now.

Hm.. seems like velocity-* strips away attachments. Ah well I'll commit
to CVS and send the link instead.

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
Rickard Öberg wrote:
> Rickard Öberg wrote:
> > The monthlist.vm test page has been updated, and I've attached it to
> > this email so you can see what it looks like,
> 
> .. which I didn't do... sigh.. attached now.

Hm.. seems like velocity-* strips away attachments. Ah well I'll commit
to CVS and send the link instead.

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
Rickard Öberg wrote:
> The monthlist.vm test page has been updated, and I've attached it to
> this email so you can see what it looks like, 

.. which I didn't do... sigh.. attached now.

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Rickard Öberg wrote:
> 
> "Geir Magnusson Jr." wrote:
> > > For the record :-) All the relevant lists are in CC
> > >
> > > Rickard Öberg wrote:
> > > > Ok, and now here's the good part:
> > > > running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.
> > >
> > > Running monthlist.vm on latest JBoss/Jetty distribution even pushes the
> > > score down to 20ms/hit on occassions (mostly around 30 though). The
> > > monthlist.jsp page takes 240 (as best, fluctuated up to 300)  on the
> > > same JBoss/Jetty dist. So, that's like 14 times better on the same
> > > servlet engine. I guess converting the JSP page to use scriptlets will
> > > speed it up, but.. that would kinda non-interesting 'cause who wants to
> > > use scriptlets anyway...
> >
> > Doesn't Jetty use Jasper?
> 
> Correct, or at least an old version of it. So it's not *that* fair. I'm
> just testing "out of the box", whereas replacing it with the latest
> Jasper would probably be more politically correct.
> 

Nah :)

Have a summary posted anywhere yet?

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Well done is better than well said - New England Proverb

Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
"Geir Magnusson Jr." wrote:
> > For the record :-) All the relevant lists are in CC
> >
> > Rickard Öberg wrote:
> > > Ok, and now here's the good part:
> > > running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.
> >
> > Running monthlist.vm on latest JBoss/Jetty distribution even pushes the
> > score down to 20ms/hit on occassions (mostly around 30 though). The
> > monthlist.jsp page takes 240 (as best, fluctuated up to 300)  on the
> > same JBoss/Jetty dist. So, that's like 14 times better on the same
> > servlet engine. I guess converting the JSP page to use scriptlets will
> > speed it up, but.. that would kinda non-interesting 'cause who wants to
> > use scriptlets anyway...
> 
> Doesn't Jetty use Jasper?

Correct, or at least an old version of it. So it's not *that* fair. I'm
just testing "out of the box", whereas replacing it with the latest
Jasper would probably be more politically correct.

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Rickard Öberg wrote:
> 
> For the record :-) All the relevant lists are in CC
> 
> Rickard Öberg wrote:
> > Ok, and now here's the good part:
> > running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.
> 
> Running monthlist.vm on latest JBoss/Jetty distribution even pushes the
> score down to 20ms/hit on occassions (mostly around 30 though). The
> monthlist.jsp page takes 240 (as best, fluctuated up to 300)  on the
> same JBoss/Jetty dist. So, that's like 14 times better on the same
> servlet engine. I guess converting the JSP page to use scriptlets will
> speed it up, but.. that would kinda non-interesting 'cause who wants to
> use scriptlets anyway...

Doesn't Jetty use Jasper?

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Well done is better than well said - New England Proverb

Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
For the record :-) All the relevant lists are in CC

Rickard Öberg wrote:
> Ok, and now here's the good part:
> running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.

Running monthlist.vm on latest JBoss/Jetty distribution even pushes the
score down to 20ms/hit on occassions (mostly around 30 though). The
monthlist.jsp page takes 240 (as best, fluctuated up to 300)  on the
same JBoss/Jetty dist. So, that's like 14 times better on the same
servlet engine. I guess converting the JSP page to use scriptlets will
speed it up, but.. that would kinda non-interesting 'cause who wants to
use scriptlets anyway...

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
For the record :-) All the relevant lists are in CC

Rickard Öberg wrote:
> Ok, and now here's the good part:
> running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.

Running monthlist.vm on latest JBoss/Jetty distribution even pushes the
score down to 20ms/hit on occassions (mostly around 30 though). The
monthlist.jsp page takes 240 (as best, fluctuated up to 300)  on the
same JBoss/Jetty dist. So, that's like 14 times better on the same
servlet engine. I guess converting the JSP page to use scriptlets will
speed it up, but.. that would kinda non-interesting 'cause who wants to
use scriptlets anyway...

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: [Webwork-user] Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
Hey

Keng Wong wrote:
> I found a similar response with Netscape when using Freemarker as well. It seems like Netscape
> buffers the entire output prior to dumping it on screen/browser.

This makes no difference though as it is just rendering time we are
talking about, i.e. the rendering of the page at the serverside.

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: [Webwork-user] Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
Attila Szegedi wrote:
> Does Netscape runs on the same machine as the server? I have noticed that
> while Netscape (4.72 on Windows) waits for a response, it hogs the CPU. So
> when I test a webapp with Netscape on the same machine that runs the server,
> I set Netscape process priority to "low".

Yup, that was the problem. So, from now on I only use IE5 to do these
tests.

/Rickard

> 
> Attila.
> 
> >
> > > -----Original Message-----
> > > From: Rickard Öberg [mailto:rickard@xpedio.com]
> > > Sent: Tuesday, August 07, 2001 7:35 AM
> > > To: webwork-user@lists.sourceforge.net
> > > Cc: velocity-user@jakarta.apache.org
> > > Subject: Re: [Webwork-user] Re: Velocity and WebWork: speed speed and
> > > more speed
> > >
> > >
> > > One weird thing though:
> > > The timings are all taken using a little WebWork action that internally
> > > uses URLConnection to get the data. This is used so as to get proper
> > > statistics by doing 100 hits at a time. Here's the weird part: when I
> > > use IE5 I get the same results as the test program, but using Netscape
> > > 4.7 I get about 90-110ms instead of 30-50ms. Might be something weird in
> > > how Netscape gets its data, but still...
> > >
> >
> >

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: [Webwork-user] Re: Velocity and WebWork: speed speed and more speed

Posted by Attila Szegedi <sz...@freemail.hu>.
Does Netscape runs on the same machine as the server? I have noticed that
while Netscape (4.72 on Windows) waits for a response, it hogs the CPU. So
when I test a webapp with Netscape on the same machine that runs the server,
I set Netscape process priority to "low".

Attila.

>
> > -----Original Message-----
> > From: Rickard Öberg [mailto:rickard@xpedio.com]
> > Sent: Tuesday, August 07, 2001 7:35 AM
> > To: webwork-user@lists.sourceforge.net
> > Cc: velocity-user@jakarta.apache.org
> > Subject: Re: [Webwork-user] Re: Velocity and WebWork: speed speed and
> > more speed
> >
> >
> > One weird thing though:
> > The timings are all taken using a little WebWork action that internally
> > uses URLConnection to get the data. This is used so as to get proper
> > statistics by doing 100 hits at a time. Here's the weird part: when I
> > use IE5 I get the same results as the test program, but using Netscape
> > 4.7 I get about 90-110ms instead of 30-50ms. Might be something weird in
> > how Netscape gets its data, but still...
> >
>
>


RE: [Webwork-user] Re: Velocity and WebWork: speed speed and more speed

Posted by Keng Wong <ke...@verizon.net>.
I found a similar response with Netscape when using Freemarker as well. It seems like Netscape
buffers the entire output prior to dumping it on screen/browser.

-keng wong

> -----Original Message-----
> From: Rickard Öberg [mailto:rickard@xpedio.com]
> Sent: Tuesday, August 07, 2001 7:35 AM
> To: webwork-user@lists.sourceforge.net
> Cc: velocity-user@jakarta.apache.org
> Subject: Re: [Webwork-user] Re: Velocity and WebWork: speed speed and
> more speed
>
>
> One weird thing though:
> The timings are all taken using a little WebWork action that internally
> uses URLConnection to get the data. This is used so as to get proper
> statistics by doing 100 hits at a time. Here's the weird part: when I
> use IE5 I get the same results as the test program, but using Netscape
> 4.7 I get about 90-110ms instead of 30-50ms. Might be something weird in
> how Netscape gets its data, but still...
>


Re: [Webwork-user] Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
"Geir Magnusson Jr." wrote:
> > Ok, and now here's the good part:
> > running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.
> >
> > Read again if you wish :-)
> 
> <picking up jaw off of desk>
> 
> I honestly will say, publicly, that I don't believe it :)

Well... me neither... but it's staring me in the face right now, and I
can rerun as many times as I want to..

One weird thing though:
The timings are all taken using a little WebWork action that internally
uses URLConnection to get the data. This is used so as to get proper
statistics by doing 100 hits at a time. Here's the weird part: when I
use IE5 I get the same results as the test program, but using Netscape
4.7 I get about 90-110ms instead of 30-50ms. Might be something weird in
how Netscape gets its data, but still...

> What hardware are you running on?  I want to see if I can get my little
> jsp vs. vel tests to scale that way on my old P2-300, so if I know your
> rig, I can see if my results make sense.

P4, 933MHz, 512MB RAM, Win2KPro

> > Still not sure just what the heck it means. Is the taglib fucked up, or
> > is our expression evaluator too slow, or what? Or is it simply the case
> > that Velocity is pretty darn snappy.
> 
> Velocity is pretty darn snappy.  And I am incredibly biased towards this
> conclusion, so take it with a huge grain of salt :)

Highly biased opinion thus ignored ;-)

> > Any ideas, comments, thoughts?
> 
> I see you got the #macro() trick to work.  What was wrong?

Don't know really. The usual editing-until-it-works approach. At least
it works now :-)

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com

Re: Velocity and WebWork: speed speed and more speed

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Rickard Öberg wrote:
> 
> Hey Velociteers and WebWorkers,
> 
> Alright, I've mucked around with Velocity all day now, and, well, it's
> going very very well. :-)))
> I've learned quite a bit about the inner workings and how to tweak
> things.
> 
> I have now added a couple of WebWork macro's (loaded automagically as a
> library, and bundled in webwork.jar for simplicity) to access some
> WebWork functionality such as instantiating actions and beans.
> 
> The monthlist.vm test page has been updated, and I've attached it to
> this email so you can see what it looks like, and also the macro
> definition template. Setting parameters of beans is still not working
> properly, and I don't know why, but it works with the $foo.setProp(..)
> format anyway.
> 
> Ok, and now here's the good part:
> running monthlist.vm on Catalina, a.k.a. Tomcat 4, takes about 30ms.
> 
> Read again if you wish :-)

<picking up jaw off of desk>

I honestly will say, publicly, that I don't believe it :)

That's fantastic.

What hardware are you running on?  I want to see if I can get my little
jsp vs. vel tests to scale that way on my old P2-300, so if I know your
rig, I can see if my results make sense.

> 
> 30ms. Consider that the exact same page in JSP-format takes about 250ms
> on Catalina and about 150ms on Orion. (and yes I did hundreds of reloads
> to ensure that the timings are stable)
> 
> Wow. Neat. Kewl.

"Wow. Neat. Kewl." indeed...
 
> Still not sure just what the heck it means. Is the taglib fucked up, or
> is our expression evaluator too slow, or what? Or is it simply the case
> that Velocity is pretty darn snappy.

Velocity is pretty darn snappy.  And I am incredibly biased towards this
conclusion, so take it with a huge grain of salt :)

> 
> Any ideas, comments, thoughts?

I see you got the #macro() trick to work.  What was wrong?

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Well done is better than well said - New England Proverb

Re: Velocity and WebWork: speed speed and more speed

Posted by Rickard Öberg <ri...@xpedio.com>.
Rickard Öberg wrote:
> The monthlist.vm test page has been updated, and I've attached it to
> this email so you can see what it looks like, 

.. which I didn't do... sigh.. attached now.

/Rickard

-- 
Rickard Öberg
Software Development Specialist
xlurc - Xpedio Linköping Ubiquitous Research Center
Author of "Mastering RMI"
Email: rickard@xpedio.com