struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeromy.ev...@blueskyminds.com.au
Subject Re: How to improve dojo performance in Struts 2.0.9
Date Mon, 24 Dec 2007 04:07:38 GMT
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.

> 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.

> 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.
The dojo plugin is the least effort approach for what you're doing.  I'd
definitely devote some time to isolating why its slow.

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.

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.

Hope that helps,
Jeromy Evans




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


Mime
View raw message