`startsWith` vs Regex

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
`startsWith`
'/foo/bar/123'.startsWith('/foo/bar')
ready
Regex
new RegExp('^\/foo\/bar').test('/foo/bar/123')
ready

Revisions

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