views:

3250

answers:

3

Well.. we've developed a j2ee application using struts2 ajax capabilities. We find that the dojo implementation is quite slow. We did the following things: 1. Custom build of the dojo library. (increased dojo.js from 240kb to 350kb) 2. Took all the static stuff out of the struts jar and kept it outside.

The performance was significantly improved. But still it is quite heavy as you can guess with 350kb size..

Is struts2 ajax supposed to be this heavy? or is there any lighter implementation available?


Edit: I used Firebug and YSlow with my application. Couple of changes that improved my situation hugely are mentioned below:

  1. Custom build of dojo (reduced the number of I/Os)
  2. Move the static files out of Struts jar (helped a great deal)
  3. tune your server to gzip the response (reduced the response size to 1/3)
  4. Reduce number of images on your site.(this is obvious)

Will keep updating on further changes..

+4  A: 
Eugene Lazutkin
Hi Eugene.. Is it usual to have dojo.js filesize of 300+ kb? since this was one of my concerns as well.. Thanks.
Satya
The base is 26k. 300k means you included a lot of other stuff.
Eugene Lazutkin
A: 

Last I checked, struts was shipping a release of Dojo (0.4) that's going on 2 years old. Dojo did a rewrite for version 0.9/1.0 that had significant performance gains and reduced code size. You should make sure you're running a recent version of Dojo (current version is 1.2.3) and use the build and tips from Eugene, above.

How good is Struts compatibility with enhanced versions of dojo? I haven't tried it but I doubt it. Thanks.
Satya
+1  A: 

Make sure you follow this faq first: http://struts.apache.org/2.x/docs/performance-tuning.html

I usually re-write my own theme instead of using the struts2 ajax theme which has dojo built in. This way I can use whatever toolkit I want to use (jQuery). I saw the biggest performance improvements when I copied the templates folder from the jar to the root web directory for the webapp.

Ruggs