Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts performance

 
Louis - Jean Morisset
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??

Thanks
Louis Morisset (pardon my English...)
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic