JavaScript Speed Wars

This post isn’t really security related or is it?

Sean Patrick Kane wrote a JavaScript speed tester which I thought was really cool. It performs and times the following tests:

  • Try/Catch with errors
  • Layer movement
  • Random number engine
  • Math engine
  • DOM speed
  • Array functions
  • String functions
  • Ajax declaration

The results were that Opera whipped Firefox and IE hands down. Sean does mention that these results are relative; however, interesting nonetheless.

I do not know enough about the browser internals (of the above listed) to know why Opera is so much faster in parsing and executing JavaScript but it is definately interesting to note. I am sure we can apply this to security in some way… :)

3 Comments so far

  1. Jason Mac @ February 5th, 2007

    Being the fastest may not be a good thing…..

    You probably don’t want give some old web page the ability to max out your CPU usage. Browsers intentionally run JavaScript at slower speeds to prevent some types of DOS attacks.

  2. david.kierznowski @ February 5th, 2007

    Jason, good point. I know timeouts are set at varying levels to allow for correct functionality (i.e. page rendering).

    With regards to DOS attack prevention, a simple alert bomb will still cause havoc on a heavily utilised winbox, so fancy timeouts do nothing in these cases… bring the fast JS parsing and execution I say :)

  3. EvilPacket @ February 7th, 2007

    Sometimes speed is a great indicator of input validation that is or is not being done. If it blows the doors off firefox and IE it may not be doing everything as tightly as it should be.

Leave a reply

Recent

Sponsored links