velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Toppe" <joc...@jtoee.com>
Subject Re: High Traffic Scenario for Velocity
Date Thu, 07 Oct 2004 10:10:25 GMT

I just did a very small and inconclusive 10-minute-setup-time load test. A
JSP and a velocity script using the velocityservlet.

<html>
  <head><title>Simple jsp page</title></head>
  <body>
    #foreach ( $i in [1..5000] )
      Count is $velocityCount
      Time is $foo.Time
      $foo.concatenate("A", "B")
      <br />
    #end
</body>
</html>

vs.

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head><title>Simple jsp page</title></head>
  <body>
  <%
    FooClass foo = new FooClass();

    for ( int i =1; i<5000; i++)
    {
      %>
      Count is <%=i%>
      Time is <%= foo.getTime() %>
      <%= foo.concatenate("A", "B") %>
      <br />
      <%
    }
  %>
  </body>
</html>

FooClass doesn't really do anything, I just wanted to have a few method
calls to an object. I then measured the response time for a http request
using jmeter. Tomcat 4.1.30.

For loopcount 500: No difference, both around 10 ms.
For loopcount 5000: jsp: 109ms, velocity: 122ms.

Now I grant you the scenario is not realistic, but they are both pretty
close in performance for such a _simple_ script. Would be interesting to
have taglibs and such (but would that be fair? there is no counterpart in
velocity).

So I don't see a 2x-3x performance degradation in JSP (which would have
suprised me).

Cheers,
  Jochen

> Thursday, October 7, 2004, 9:09:01 AM, Jochen Toppe wrote:
>
>
>> Interesting. I will have definite figures in my hand in a few weeks :)
>> I'll post them.
>>
>>
>> Jochen
>>
>>
>>> In my experience, your assumption is wrong.  I think I've spilled
>>> this to the list before... I once had a small app that I wrote using
>>> exclusive servlets/velocity.  Then I realized I'd created a small app
>>> that only *I* could maintain because no one else knew/loved velocity
>>> like I did. I also needed to start adding graphs to my app, and I went
>>> the easy cewolf/jfreechart route (which requires jsp/taglibs).
>>>
>>> Anyways... even on the pages without taglibs (to satisfy those that
>>> say "it's the taglibs"), I found that when I re-wrote my pages as JSP,
>>> the pages were (anecdotally, and completely unofficially with no stats
>>> to back it up).. at least 2-3x slower.
> [snip]
>
>
> I understand that what you say it "anecdotally, and completely
> unofficially", but still, how did you measured that? Between which points
> of the response production? How big time are we talking about (say, 0.01 s
> versus 0.02-0.03 s)?
>
> --
> Best regards,
> Daniel Dekany
>
>
>
> ____________________________________________________________________
> Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a
> FreeStarttol.
> Probald ki most! http://www.freestart.hu
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message