Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:forEach performance hit

 
Srinivasan thoyyeti
Ranch Hand
Posts: 557
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

Scenario:
I need to display a big Grid 25(rows)x45(column) cells.

Design done like this:

STEP 1. Among 45 columns 5 properties repeat 9 times.
So came up with bean of five properties.
hence each row can be represented as 9 such beans.
(let the bean name be "SampleBean")

STEP 2. Now for 25 rows I have declared 25 list type collections.
Like


STEP 3. Now in jsp I am printing each list using forEach, 25 times
like


Problem with JSP loading(A performance hit):
As the servlet transalted from jsp contains 25 do-while loops and custum tag(forEach) life cycles calls, jsp loading taking time.

So I want to know How best we can handle this type design issues ?
(I am using struts on top of jsps but using JSTL(forEach))

Thanks in advance.

[ January 22, 2008: Message edited by: Srinivasan thoyyeti ]
[ January 22, 2008: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Out of curiosity, why are you mixing JSTL with Struts?
Why not use the Struts iterate tags?


Are you actually seeing performance problems?
Have you narrowed it down to JSP processing (as opposed to DAO or network lag)?

25 x 45 while not small isn't exactly huge either.
[ January 22, 2008: Message edited by: Ben Souther ]
 
Srinivasan thoyyeti
Ranch Hand
Posts: 557
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben Souther,

I have found the performance hit reason:

We are loading 25x45 text box cells into that grid.
So completly struck with it.

How to tackle this ???

Shall I have to reduce the no of text boxes loaded ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic