aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Performance issue? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Performance issue?" Watch "Performance issue?" New topic
Author

Performance issue?

Santana Iyer
Ranch Hand

Joined: Jun 13, 2005
Posts: 335
Hi,

I have jsp page where I display records (records come from file so number of records per page can be anywhere from 1 to 10000).

I am providing checkbox with every record ( name as chk1 ... chk1000). With Select All option at top.

On click of select all I call function in javascript.



It takes 5 seconds with 1000 records.

Is there any better/faster way. Because requirement is that there can be 10000 records too.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by Santana Iyer:

It takes 5 seconds with 1000 records.
requirement is that there can be 10000 records too.


Why you want to display these many records in a single page?
Whats wrong if you do pagination?


My blood is tested +ve for Java.
Santana Iyer
Ranch Hand

Joined: Jun 13, 2005
Posts: 335
Valid point even I raised same question to my senior, but he wants it like that as it is in requirements by client.

Actually number of total records are 1 million or so ......
[ September 26, 2006: Message edited by: Santana Iyer ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It is going to be slow, JavaScript is not good at looping large things with processing. SOme browsers may choke.

Eric
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
When you click on Select All button, set hidden parameter (selectAll = true) and submit the form(without turning on all check boxes to checked).

In request handler, first check the value if request.getParameter("selectaAll") and process further.

I believe your browser is taking time to make all checkboxes checked. By doing above you are eliminating it.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
could also try selecting multiples of check boxes with larger steps. (AKA) hard code 5, step by 5.

Than a small loop to get the ones outside a step of 5.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Performance issue?