More benchmarking in the vs issue

I’ve done a little more benchmarking in the vs. issue:

<script>var start=new Date();</script>

<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>

<script>var stop=new Date(); alert(stop.getTime() - start.getTime());</script>

What this code does, is to try to include javascript files from five sites and measure the time it takes to process these tags. This testcase was selected because current browsers load the scripts synchronously (the reasons being that the loaded script might modify the current document) and also it is a commonly used method for including third-party content (advertisements, gadgets, etc). The result are:

  • Firefox (3.5) showed no difference: the timing always was a couple of milliseconds
  • Internet Explorer (8) and Google Chrome (2.0) showed quite a large difference in favor of when using it, the pages constantly loaded in tens of milliseconds (between 0 and 30), while using meant a page load time closer to a second (between 900 and 1500 milliseconds).
  • Using Opera (9.64) the results were even further apart: the case took ~1 second, while the case took around 25 (!!!) seconds.

All the measurements were repeated multiple times to ensure their validity. The machine used for this test was running Windows XP with all the latest updates and without any webserver. IMHO this is yet an other argument in favor of using instead of when trying to block hosts.

, ,

Leave a Reply

Your email address will not be published. Required fields are marked *