eval vs fn

Benchmark created by Chris on


Preparation HTML

<script>
  function calc() {
      return Math.sin(10/20 * (Math.PI/2));
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
eval
var foo = eval('Math.sin(10/20 * (Math.PI / 2));');
ready
fn
var foo = calc();
ready

Revisions

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