aspose file tools*
The moose likes JSP and the fly likes JSTL foreach Loops Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL foreach Loops" Watch "JSTL foreach Loops" New topic
Author

JSTL foreach Loops

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1419
I am using JSTL foreach loops to populate a table. The process is very slow when record list more than a few hundred records. Is there any way to speed it up or another solution? One instance I have almost 2000 records and it taks a while to populate.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Have you determined where the holdup is? DB fetch? Other?

And... is it really useful to display so much data in the first place? Most apps would use paging and filtering to limit the amount of data that needs to be displayed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1419
Bear Bibeault wrote:Have you determined where the holdup is? DB fetch? Other?

And... is it really useful to display so much data in the first place? Most apps would use paging and filtering to limit the amount of data that needs to be displayed.


The DB fetch just takes 12 seconds or less.

I am pretty sure the lag is in the page where the table is being populated.

The data is a list of engineering drawings waiting sign-off in various queue locations. While most queues have less than 100 records one particular queue has the 2000 records.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Wow, "just" 12 seconds? That's glacial. How long is the page render taking?

I can't imagine anything in the JSP/JSTL creating any kind of substantial bottleneck. The only thing I can think of off the top of my head is that one of the references in the loop (perhaps a getter for one of your beans?) is calling code that is slowing things down.

Time to get out a profiler tool I believe.
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1419
Bear Bibeault wrote:Wow, "just" 12 seconds? That's glacial. How long is the page render taking?

I can't imagine anything in the JSP/JSTL creating any kind of substantial bottleneck. The only thing I can think of off the top of my head is that one of the references in the loop (perhaps a getter for one of your beans?) is calling code that is slowing things down.

Time to get out a profiler tool I believe.


My DB fetch was slightly off:

2.7 seconds for DB fetch

22.9 seconds for table to appear loaded.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Is this in IE? Have you tried other browsers?
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1419
Bear Bibeault wrote:Is this in IE? Have you tried other browsers?


Just IE it is all we use at our company.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

I repeat: have you tried it another browser?
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1419
Bear Bibeault wrote:I repeat: have you tried it another browser?


No, I have not.
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
I have similar doubt so I didn't create a new topic. Hope that's not hijacking.

I have a drop down which loads thousands of records (around 45K). At many places I have applied the filters (according to business context) to limit the number of records but for few places it's just not possible. Ok for those cases, it takes about 7+ seconds, which is not acceptable at all.and it becomes worst when you have to load it more than once in the same page.

Now my question is , does it take long just because number of records are huge? I use c:forEach loop to iterate. and pass the list as Map or List.

PS :- As a workaround I have replaced the dropdown with auto suggestion box. Is it smart move?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Vikas Kapoor wrote:PS :- As a workaround I have replaced the dropdown with auto suggestion box. Is it smart move?

That's not a work-around, that's a solution.

A drop-down with more than a dozen or two entries is too long and rapidly becomes useless -- even if the performance was acceptable.
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Bear Bibeault wrote:
Vikas Kapoor wrote:PS :- As a workaround I have replaced the dropdown with auto suggestion box. Is it smart move?

That's not a work-around, that's a solution.

A drop-down with more than a dozen or two entries is too long and rapidly becomes useless -- even if the performance was acceptable.


Thank you Bear!
 
 
subject: JSTL foreach Loops