Saturday, 6 April 2013

Testing javascript on different browsers

So today I'm sitting in the Apple store in Birmingham Uk, I decided to play with the new thin Apple iMac 27inch  Late 2012 model.  I was curious on how fast the machine was so I thought to my self how would I go about testing.  Well since I use the web a lot I thought lets test javascript first so I did a search and found the "SunSpider" page which will run some javascript tests on your browser.

So I set up both my Apple MacBook Air  and the iMac to the same page both on the same version of Safari and ran the tests at the same time.  Now I expected the faster iMac to finish the test quicker than the Mac Book Air.  but it was the other way around.  and I cant for the life of me figure out why?

My Laptop has a 1.8Ghz processor and 4 GB Ram while the iMac has 3.2 ghz & 8 GB ram

The Mac Book Air could run the test suite 5.25 times before the iMac finished running the test for the first time.  Now for the results and you will see that the Physical tests the iMac preformed better on each and every test it seems that the iMac paused between tests and that is the bit i'm not understanding.

NOTE:: if any one can test it on their home machine I would be interested in their results my Mac Air took 23 seconds to run the test while the iMac took 2 minutes 20 seconds when I timed them

Assumption
I can only assume that the browser is accessing the harddrive between tests as the MacAir has an SSD hard drive.

Results

Mac Book Air


============================================
RESULTS (means and 95% confidence intervals)
--------------------------------------------
Total:                 184.9ms +/- 9.3%
--------------------------------------------

  3d:                   29.1ms +/- 14.7%
    cube:                9.7ms +/- 32.8%
    morph:               8.7ms +/- 13.4%
    raytrace:           10.7ms +/- 12.2%

  access:               18.1ms +/- 8.8%
    binary-trees:        2.6ms +/- 53.7%
    fannkuch:            7.1ms +/- 7.4%
    nbody:               3.8ms +/- 17.3%
    nsieve:              4.6ms +/- 10.9%

  bitops:                9.4ms +/- 8.2%
    3bit-bits-in-byte:   1.3ms +/- 26.6%
    bits-in-byte:        2.6ms +/- 14.2%
    bitwise-and:         2.4ms +/- 15.4%
    nsieve-bits:         3.1ms +/- 7.3%

  controlflow:           2.2ms +/- 13.7%
    recursive:           2.2ms +/- 13.7%

  crypto:               14.4ms +/- 13.5%
    aes:                 8.8ms +/- 20.5%
    md5:                 3.1ms +/- 7.3%
    sha1:                2.5ms +/- 15.1%

  date:                 24.3ms +/- 15.4%
    format-tofte:       13.0ms +/- 16.0%
    format-xparb:       11.3ms +/- 15.2%

  math:                 13.2ms +/- 5.0%
    cordic:              3.4ms +/- 10.9%
    partial-sums:        7.0ms +/- 4.8%
    spectral-norm:       2.8ms +/- 10.8%

  regexp:                9.2ms +/- 8.0%
    dna:                 9.2ms +/- 8.0%

  string:               65.0ms +/- 12.9%
    base64:              5.5ms +/- 6.8%
    fasta:               8.5ms +/- 16.0%
    tagcloud:           12.7ms +/- 11.9%
    unpack-code:        25.2ms +/- 19.8%
    validate-input:     13.1ms +/- 29.1%

The iMac
============================================
RESULTS (means and 95% confidence intervals)
--------------------------------------------
Total:                 128.4ms +/- 3.1%
--------------------------------------------

  3d:                   19.2ms +/- 5.4%
    cube:                6.4ms +/- 10.6%
    morph:               5.2ms +/- 10.7%
    raytrace:            7.6ms +/- 9.0%

  access:               12.0ms +/- 14.7%
    binary-trees:        1.2ms +/- 46.3%
    fannkuch:            5.4ms +/- 12.6%
    nbody:               2.8ms +/- 19.9%
    nsieve:              2.6ms +/- 26.2%

  bitops:                7.4ms +/- 9.2%
    3bit-bits-in-byte:   0.8ms +/- 69.5%
    bits-in-byte:        2.0ms +/- 0.0%
    bitwise-and:         2.0ms +/- 0.0%
    nsieve-bits:         2.6ms +/- 26.2%

  controlflow:           1.8ms +/- 30.9%
    recursive:           1.8ms +/- 30.9%

  crypto:               10.8ms +/- 5.1%
    aes:                 6.2ms +/- 9.0%
    md5:                 2.6ms +/- 26.2%
    sha1:                2.0ms +/- 0.0%

  date:                 17.0ms +/- 0.0%
    format-tofte:        9.0ms +/- 0.0%
    format-xparb:        8.0ms +/- 0.0%

  math:                 10.4ms +/- 6.5%
    cordic:              3.0ms +/- 0.0%
    partial-sums:        5.4ms +/- 12.6%
    spectral-norm:       2.0ms +/- 0.0%

  regexp:                6.8ms +/- 8.2%
    dna:                 6.8ms +/- 8.2%

  string:               43.0ms +/- 5.4%
    base64:              4.8ms +/- 21.7%
    fasta:               5.8ms +/- 9.6%
    tagcloud:            8.6ms +/- 7.9%
    unpack-code:        16.2ms +/- 3.4%
    validate-input:      7.6ms +/- 9.0%