eval vs RegExp

Benchmark created on


Preparation HTML

<script>
  var test = "test";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
eval
var regex = eval('/\b' + test + '\b/');
ready
regexp
var regex = new RegExp('\\b' + test + '\\b');
ready

Revisions

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