regExp-v8-perf

JavaScript performance comparison

Test case created by Shahar Soel

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
              var stringLiteralRegExp = /'([^\\']+|\\([bfnrtv'\\/]|u[0-9a-fA-F]{4}))*'/g
  
              var stringLiteralRegExpNoPlus = /'([^\\']|\\([bfnrtv'\\/]|u[0-9a-fA-F]{4}))*'/g
  
  

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
base char number
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosen\'t match real type`);'
                    .replace(stringLiteralRegExp, "")
pending…
one extra char
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosen\'t match real type`);a'
                    .replace(stringLiteralRegExp, "")
pending…
two extra chars
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosen\'t match real type`);aa'
                    .replace(stringLiteralRegExp, "")
pending…
three extra chars
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosen\'t match real type`);aaa'
                    .replace(stringLiteralRegExp, "")
pending…
four extra chars
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosen\'t match real type`);aaaa'
                    .replace(stringLiteralRegExp, "")
pending…
five extra chars
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosen\'t match real type`);aaaaa'
                    .replace(stringLiteralRegExp, "")
pending…
no inner single quote
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosent match real type`);aaaaa'
                    .replace(stringLiteralRegExp, "")
pending…
no plus modifier
var out =
                '   throw new TypeError(`Type hint "${typeHintName}" dosent match real type`);aaaaa'
                    .replace(stringLiteralRegExpNoPlus, "")
pending…

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

0 Comments