File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts performance" Watch "Struts performance" New topic

Struts performance

Louis - Jean Morisset

Joined: Aug 25, 2003
Posts: 20
I really have two questions!
1- If you have a strut-config.xml that is lets say 4000 actions tags.(just for the sake of discussion) and that you only use 1000 of those actions tags. (Reason for only using 1000 is because of a merge in old an new project bla bla bla). So now, when we start the application, the Struts framework parses the struts-config.xml into classes, I suppose?? and loads it into memory. Right?? And the fact that you only use 1/4 of the action tags, the 3/4 that are loaded for nothing, will it impact performances??? And how dramatically will it impact performances if it does???
2- I was told that Java introspection was not very performant. I was very supprised to hear that, but I dought my source. So I thought I would ask here. I'm sure that Java introspection for javaBeans loading either in plain java or Struts is finelly tuned, right ??

Louis Morisset (pardon my English...)
Rick Hightower
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
action mappings get put into a hash map. 4000 items in a hashmap is not a major drain on performance.
reflection is pretty fast since JDK1.3. if i remember correctly it use to be 20x slower to invoke a method reflection than to invoke directly. since JDK1.3 it is only twice as slow. i guess that equates to 2 nano seconds vs. 1 nano second... not too much to worry about. if you are worried, write a test using JUnitPerf. call a method on the same object a few billion times using reflection and then directly... see which one is faster. in truth, it is dust on the scale compared to other things you could do to improve performance in a web app (data caching, page caching, etc.).

Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
I agree. Here's the link:
subject: Struts performance
It's not a secret anymore!