diTii.com Digital News Hub

Sign up with your email address to be the first to know about latest news and more.

I agree to have my personal information transfered to MailChimp (more information)


Safari 3 Benchmarking

Mark Wilton-Jones has written a detailed article on the behaviour and speed of Safari 3 in which he talks “how Safari fires onload at a different time than most other browsers”, and other implementation details that mean that you can’t trust JavaScript in the page to do any benchmarking.

In Safari, it seems onload fires before the page has been displayed, before layout has been calculated, before any costly reflows have taken place. It fires before images have completed loading (this can also happen in rare cases in Opera, but Safari seems to do it everywhere), meaning that a substantial part of the load time is not included. So basically, onload is not trustworthy in Safari for checking page loading times.

It is possible to force Safari to layout the page before checking for the time. To do this, check for the offset values of any element, such as the offsetWidth of the body:

window.onload = function () {
  var ignoreMe = document.body.offsetWidth;
  var endTime = new Date();

Full article

Apple, Sarari 3.0, Benchmarking, Article

Share This Story, Choose Your Platform!

Do NOT follow this link or you will be banned from the site!