Regexp vs String

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
new RegExp('lorean','i').test('lore')
new RegExp('lorean','i').test('lore')
new RegExp('lorean','i').test('lore')
new RegExp('lorean','i').test('lore')
new RegExp('lorean','i').test('lore')
new RegExp('lorean','i').test('lore')
ready
string
'lorean'.toLowerCase().includes('lore'.toLowerCase())
'lorean'.toLowerCase().includes('lore'.toLowerCase())
'lorean'.toLowerCase().includes('lore'.toLowerCase())
'lorean'.toLowerCase().includes('lore'.toLowerCase())
'lorean'.toLowerCase().includes('lore'.toLowerCase())
'lorean'.toLowerCase().includes('lore'.toLowerCase())
ready

Revisions

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