Large html pages and slow load times/high CPU usage

Anton Markov anton-F0u+EriZ6ihBDgjK7y7TUQ at public.gmane.org
Wed Jun 15 02:02:44 UTC 2005


On Tuesday 14 June 2005 02:00, Peter wrote:
> On Mon, 13 Jun 2005, Madison Kelly wrote:
> > Hi all,
> >
> >  I have problem with my program that I am wondering if a work-around
> > exists for.
> >
> >  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. I am running the program on the
> > same machine that the browser is running on so bandwidth shouldn't be the
> > issue (it's all via 'localhost:853').
> >
> >  When I send the output to a text file (the log) instead of the the
> > browser the page "loads" in a few seconds. This should mean then that the
> > code itself is not the source of the bottle neck. 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)? Is it latency somewhere else (TCP/IP)? Any
> > hints/tips would be great!
>
> Make sure your html file has perfect syntax (lint the page using a
> validator) and add the header Connection: close to the server response
> headers.
>

Once you make your syntax perfect, be sure to add a DOCTYPE to your HTML 
output (preferably something like XHTML 1.0 Strict). This will tell smart 
browsers like Firefox to not try and work around possible mistakes.

Another option you should test is not using tables at all. I don't know about 
the performance of very large pages, but CSS _may_ be faster then tables 
(although it could also depend on the browser).

-- 
Anton Markov <("anton" + "@" + "truxtar" + "." + "com")>

GnuPG Key fingerprint = 
5546 A6E2 1FFB 9BB8 15C3  CE34 46B7 8D93 3AD1 44B4

*** LINUX - MAY THE SOURCE BE WITH YOU! ***
--
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