eval()

Benchmark created by Mathias Bynens on


Description

Code from Florian Loitsch and Ben Alman

Preparation HTML

<script>
  var awesome = window['evil'.replace('i', 'a')]; // See? Much nicer!
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Normal eval()
if (eval('42') != 42) {
 throw 'oops';
};
ready
Context-less eval()
if (eval.call(null, '42') != 42) {
 throw 'oops';
};
ready
Awesome eval()
if (awesome('42') != 42) {
 throw 'oops';
};
ready

Revisions

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