• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Performance issue?

 
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Santana Iyer
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic