Browserdetect vs php

JavaScript performance comparison

Test case created by Ben Thompson

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Browser detect
(function(u, g, w, s, o, m, t, h) {
        var ua = u.toLowerCase(),
          is = function(t) {
                return ua.indexOf(t) > -1;
        },
          b =
          [(!(/opera|webtv/i.test(ua)) && /msie\s(\d\d?)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('blackberry') ? m + ' blackberry' : is('android') ? m + ' android' : is('chrome') ? w + ' chrome' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('iphone') ? m + ' iphone' + (/iphone\sos\s(\d+)/.test(ua) ? ' ios' + RegExp.$1 : '') : is('ipod') ? m + ' ipod' : is('ipad') ? t + ' ipad' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : '') : (is('x11') || is('linux')) ? 'linux' : ''],
          c = b.join(' ');
        h.className += ' ' + c;
        return c;
})(navigator.userAgent, 'gecko', 'webkit', 'safari', 'opera', 'mobile', 'tablet', document.documentElement);
pending…
Add header
document.getElementsByTagName('html')[0].className += "ff ff12 gecko win";
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

2 comments

continuing education credits commented :

I think that everything said made a bunch of sense. But, think on this, what if you added a little content? I mean, I don't wish to tell you how to run your blog, however what if you added a post title that grabbed people's attention? I mean Browserdetect vs php · jsPerf is kinda boring.

You could glance at Yahoo's front page and see how they create article titles to get people to open the links. You might add a related video or a related picture or two to get people interested about everything've got to say. Just my opinion, it would make your posts a little bit more interesting.

freecultr promo commented :

We're a group of volunteers and starting a new scheme in our community. Your web site offered us with valuable information to work on. You have done a formidable job and our entire community will be thankful to you.

Add a comment