pre-compiled Regexp besides not pre-compiled

Benchmark created by Tomas Corral on


Preparation HTML

<script>
  var REGEXP = /abc/;
  function method1(string){
  return string.match(REGEXP);
  }
  function method2(string){
  return string.match(/abc/);
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Pre-compiled
method1("juanete");
ready
Not pre-compiled
method2("juanete");
ready

Revisions

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

  • Revision 1: published by Tomas Corral on