struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nunnari <>
Subject Re: How to improve dojo performance in Struts 2.0.9
Date Tue, 25 Dec 2007 21:01:47 GMT
Hi Jeromy.

Thank you for your reply! My comments below: wrote:
> Roberto Nunnari wrote:
>> Hi Jeromy and list.
>> I'm trying a self built struts-2.1.1-snapshot with the dojo plugin
>> and I'm seeing very slow dojo performance.. I thought that the dojo
>> performance problem whould be solved in 2.1.1 using the plugin, but
>> it doesn't seam so now to me..
> Hi Roberto,
> Before anything else, try to isolate the problem a little as there's many
> of possible causes of a performance problem.
> I'd first install the FireBug plugin into Firefox to check if there's any
> javascript errors, 404's or if there really are too many requests.
> If there's lots of requests it'll be a slow experience for the user and
> that's that's when creating a custom dojo profile will help.

yes.. there were many requests, but I can't quantify as I discovered
the dojo tree widget and as it works great for what I need I moved
to that!

>> So.. I have two questions:
>> 1) do the information you posted (see below) about improving 2.0.9 dojo
> performance apply to version 2.1.1-snapshot as well?
> Yes, this applies to Struts2.1 as well, however a customised dojo profile
> is already distributed with the dojo plugin.  It can still be optimized,
> but it should be pretty good already.
> Some people have commented that the single biggest performance improvement
> is to move dojo's static content out of the struts2 jars and serve it
> directly (preferably from apache rather than tomcat).  This is described
> on the wiki.

Yes.. I believe that's right, but wouldn't it be great if we were
able to tell tomcat/struts to keep some static web resources from jar
files in cache (already decompressed and ready to be sent to clients)?

>> 2) would it be easier to use raw dojo instead? I just have to update
>> a div and at the same time notifyTopics using a <sx:a> tag.. or maybe
> the yui plugin? what would you suggest?
> There's no reason why you should experience significant performance
> problems if that's all you need.

actually in my page there were about 10 <sx:a> tags.. that's maybe
an important factor to why it was so slow..

> The dojo plugin is the least effort approach for what you're doing.  I'd
> definitely devote some time to isolating why its slow.

If I get round to, I'll certantly try to find the bottleneck

> Writing direct dojo code will mean you can control which resources are
> specifically loaded and you will get better performance, but it's still
> essential to build a customised dojo profile.

yes.. I guess so..

> The YUI plugin itself doesn't have what you've described, although a patch
> is sitting in the issues register to add yui:div, yui:a and yui:submit.  I
> use these myself.  If you use YUI, you'd still need to write a custom
> listener to do the equivalent of notifyTopics, so it's a little more
> effort.
> A significant performance issue that's often overlooked is that javascript
> is single threaded while <script> blocks are executed rendering in the
> brower is blocked.  You can improve the RENDERING of a page significantly
> simply by placing the scripts/script includes at the bottom of the body.
> My bet is that this is what causes most of the problems as dojo does a lot
> of page parsing, but only hand-crafted javascript will allow you to
> correct this.

This is a very important note.. I'll that out ASAP!

Merry Christmas and Happy New Year!

Best regards.


> Hope that helps,
> Jeromy Evans
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message