Large html pages and slow load times/high CPU usage

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Mon Jun 13 22:46:39 UTC 2005


Henry Spencer wrote:
> On Mon, 13 Jun 2005, Madison Kelly wrote:
> 
>>   I am stress-testing my backup program now and I've noticed that with 
>>a sample partition with ~26,000 directories when they are all set to be 
>>displayed it creates a ~1.5MB html file...  When I send the 
>>output to the browser though Mozilla jumps to 100% CPU usage and it take 
>>a very long time (minutes) to load the same data.
>>   Is the browser taking time because of the render time (each directory 
>>creates a cell in a table)?
> 
> 
> Rendering of huge tables is almost always slow, especially if the machine
> doesn't have piles of memory.  It's typically necessary for the browser to
> build up a data structure representing the *entire* table before it can
> decide how wide columns should be etc.  This takes a long time and a very
> large amount of memory (the representation is often quite inefficient),
> and especially if that's driving your machine into paging/swapping, it's
> not too surprising that it's slow. 
> 
> If you can find some way of breaking that table up into smaller ones, or
> using something simpler than a table, odds are you'll see a major
> improvement. 
> 
>                                                           Henry Spencer
>                                                        henry-lqW1N6Cllo0sV2N9l4h3zg at public.gmane.org

Hi, I broke each cell into it's own table which obviosuly increased the 
data size but just as you said cut the display time down from ~5 minutes 
to 62 seconds for my test. Not a bad performance boost, if I do say so 
myself. :D Still need it faster though, if possible.

Maybe if I turn off perl's buffers? That should show the user that 
something is happening and prevent timeouts. I wonder how much overhead 
that will add? Time to experiment!

Thanks very much!

Madison

Madison

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Madison Kelly (Digimer)
TLE-BU, The Linux Experience; Back Up
http://tle-bu.thelinuxexperience.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list