• Post Reply Bookmark Topic Watch Topic
  • New Topic

Page loading time  RSS feed

 
John Mallavalli
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have an operation which needs to fetch more than 1000 records of data from the database to the jsp and in the jsp I am constructing a HTML table and then displaying the table. The problem is that I am not able to load this page even after one hour.
I had checked that the database operation is not taking more than 2 to 3 seconds as there are relevant indexes in place.
So please anyone help me out in reducing the page loading time. Thanks in advance.
John
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, is it really necessary to show all those records? Is that much data actually useful to your users? Give that some thought... you might be better off (or at least your users will) to page through the data in smaller increments.
That said, if you must send all that data, be sure to use really terse html in the loop that generates the rows. Remeber that whatever html you use to render a single row is multiplied by the total number of rows and can build up fast.
Judicious use of CSS rules can almost eliminate any markup for visual rendering (you aren't using the <font> tag or anything like that, are you?), and factoring out any other uneccesary markup may make a difference.
hth,
bear
P.S. But I still contend that breaking up large data sets makes more sense on both the technical and usability fronts.
[ March 05, 2003: Message edited by: Bear Bibeault ]
 
John Mallavalli
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,
In fact, I dont use this operation of displaying all the data very often. I am actually paginating the data. But when I want to show all the data at one shot(one of my application's requirement) this problem of the page not turning up even after an hour arises. It does turn up but only after an hour or so.
And the logic which I am using is exactly in line with whatever you had specified in your reply.
Thanks in advance.
John
 
amit indian
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
as u have so many records, the html will cache all of them in the browsers memory until the entire table is not made, this will take a lot of memory and ur browser is crashing,
its solution is to break ur table in parts, that is for each 100 records break ur table. for this u can put an if loop if(ctr%100 == 0) then complete the table and write out.println();
then make a new tbale for next 100 records and so on.
this will 100% solve ur problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!