RegExp vs toLowerCase (v3)

Revision 3 of this benchmark created on


Description

Looks like regular expressions in Chrome are even faster than plain string comparation.

Preparation HTML

<script>
  var a = 'HeLlo wORld', d = a.toLowerCase(), e = /^hello world$/i;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
RegExp
e.test(a)
ready
toLowerCase
a.toLowerCase() == d
ready

Revisions

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