string contains (v2)

Revision 2 of this benchmark created on


Description

comparing regex to contains

Setup

const a = "the brown fox jumped of the lazy log"
const rx = /^[a-zA-Z ]+$/
const chars = ['f','y','n']

Test runner

Ready to run.

Testing in
TestOps/sec
regex match
a.match(rx)
ready
contains
chars.some(c => a.includes(c))
ready
regex search
rx.test(a)
ready

Revisions

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