Cache v No Cache

Benchmark created by dave on


Preparation HTML

<script>
  function len1( v ) {
    return Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
  }
  
  function len2( v ) {
    var v0 = v[0], v1 = v[1], v2 = v[2];
    return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
No Cache
len1([1,2,3]);
 
ready
Cache
len2([1,2,3]);
ready

Revisions

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