Counting primes in Google Chrome

A while back I put together a quick prime counting test for Flash and Silverlight.

As someone noted, this test runs remarkably fast in Chrome, thanks to the V8 JavaScript engine.

Here’s the JavaScript version of the test – note that you cannot easily run this in IE or Firefox for larger values, because the script times out, though you can configure your browser to prevent this.

Here are my figures on Vista (lower is better):

  1. Microsoft Silverlight 2.0 beta 2: 0.464 secs
  2. JavaScript Google Chrome: 1.4 secs
  3. Adobe Flash: 1.667 secs
  4. JavaScript Mozilla Firefox 3: 6.046 secs
  5. JavaScript Microsoft IE7: 11.916 secs

I can’t easily test IE8 as I have it installed in a virtual machine.

2 thoughts on “Counting primes in Google Chrome”

  1. Wow – that’s an impressive result for Chrome. I did a similar test with and you just can’t ignore this sort of performance from Chrome. It puts Ajax back in the game against Silverlight and Flash. It’s also the sort of thing that users will warm to quickly I think, because the performance is noticeably better for anyone browsing. It’s going to be interesting to see the take up of Chrome…

  2. Thanks for the benchmark page.
    On my laptop the difference is more noticeable
    Google Chrome 4.89s
    Firefox: 27.4s

    I tried in IE8 but there is an annoying popup that tells me that a script is now running slowly and I’m asked if I want to stop it.

Comments are closed.