[thelist] A question on optimization.

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Fri Mar 18 15:11:51 CST 2005


Hi evolters!

First of all thank you for all your input. Secondly sorry for the
latency in my reply. This week was a nightmare for me full of "urgent"
bug fixes, piles of papes, endless phone calls, sleepless-nights and
over-dose of caffeine, plus a surgery  in my mouth (not a fill-cavity
stuff, a real surgery) and thus spending the whole week as an
Apranax-Fort addict :)

As per the test results: We tested the page a dozen times on an 56K
connection, clearing the temporary internet cache before each test. On
the average, the first half (the part before the scripts at the
bottom) loaded in 8 seconds, the second half loaded in 8 seconds in
the background. Which totals around 16 seconds, which the user
"perceives" as 8 seconds, because he is busy with the images and text
while the rest of the script loads.

In the list below the responses are listed in the order they load into
memory. Although during different tests the load order slightly
changed (note the comments given with asterisks (*) ) the general
trend is pretty predictable.

- using defer is another pretty good idea (since most of the audiance
will be IE users, why not give them a favor.) Thanks for the tip :)

reply to chris : 
<snip>
>Yes, but from a maintainability point of view it is a nightmare. HTML can
>be parsed and used, mixed HTML and scripts and inline CSS can't be parsed
>and reused.
</snip>

there is no single inline script on the page. All the scripts are
included in external js files using

<script type="text/javascript" src="/webroot/scripts/blah.js"></script>

format. 

We put our best efforts at least to approximate an unobstrusive,
usable, accessible and w3c compliant HTML and CSS. Actually our client
requests it, but the reason he requests and the reason we implement it
are totally different: He requests it, cuz he has heard it has been a
trend, he requests it to use it as a badge of honor. We implement it
because we have gained an insight on the real benefits of standards
and accessibility. Thanks everyone who struggle on the web for this.

imho our hard work will pay off some time and maintanaibility will not
be a big issue.

Here is a typical test result for the interested:

Load order    |  Size of request body
HTML Body   |  9.438 Bytes 
Site Logo   |  4.292 Bytes
Master Css  |  6.666 Bytes
Image  1    |  9.225 Bytes
Image  2    |  1.979 Bytes
Image  3    |    185 Bytes		
Image  4    |  1.260 Bytes
Image  5    |    190 Bytes	
Image  6    |    177 Bytes
Image  7    |     43 Bytes
Image  8    |     65 Bytes
Image  9    | 29.836 Bytes	
script  1   |    804 Bytes * just this script is loaded out of order.
Image 10    |  1.490 Bytes 
Image 11    |    299 Bytes
Image 12    |  1.097 Bytes
Image 13    |  6.757 Bytes
Image 14    |  1.182 Bytes
--------------------------
* at this point scripts start loading one after another. (up to this part takes
more or less 8 seconds)

script  2   |  3.697 Bytes * all the scripts are loaded
script  3   |  1.506 Bytes * in the order they appear in code
script  4   |    629 Bytes * most of the scripts that are at 
script  5   |  3.141 Bytes * the end of the source code loaded
script  6   |  1.723 Bytes * almost after everything has loaded.
script  7   |  2.755 Bytes
script  8   | 10.380 Bytes
script  9   |    712 Bytes
script 10   | 12.695 Bytes
script 11   |  4.112 Bytes
script 12   |    842 Bytes         
script 13   |  3.147 Bytes
script 14   |  2.378 Bytes
script 15   |  1.895 Bytes
script 16   |  1.611 Bytes
script 17   |  9.892 Bytes
script 18   |    892 Bytes
script 19   |    584 Bytes
script 20   |  2.082 Bytes
script 21   |  2.168 Bytes
script 22   |  1.131 Bytes
Image 15    |  1.470 Bytes * this image is an exception as well
                           * actually it appears far above in the source code.


Cheers,
Volkan.

__________________________________________________________________

On Mon, 14 Mar 2005 08:20:58 -0500, Joshua Olson <joshua at waetech.com> wrote:
> > -----Original Message-----
> > From: Andrew Clover
> > Sent: Monday, March 14, 2005 6:02 AM
> 
> > ... you can give the
> > browser a hint that it doesn't need to load the whole script before
> > continuing to parse the page (and load its images):
> >
> >    <script type="text/javascript" src="blah.js"
> > defer="defer"></script>
> >
> > However I believe the only browser to take advantage of this
> > possibility (AFAIK) is IE/Win.
> 
> As Andrew pointed out, using defer is a great way to force a script to be
> loaded only after the page load is complete.  Compatibility across browsers
> is not guaranteed, however.  You can implement your own sort of "defer" by
> programmatically (through DOM) adding a script block to the head from the
> body's onload handler.
> 
> Use the tenets of a Tip provided by Keith Gaughan for reference:
> 
> http://lists.evolt.org/harvest/detail.cgi?id=6257
> 
> Best of luck,
> 
> <><><><><><><><><><>
> Joshua Olson
> Web Application Engineer
> WAE Tech Inc.
> http://www.waetech.com/service_areas/
> 706.210.0168
> 
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list