substr vs split

Benchmark created on


Setup

const address = '1345 albany street, Bellevue WA 42344'

Test runner

Ready to run.

Testing in
TestOps/sec
substr
address.substring(0, address.indexOf(','))
ready
split
address.split(',')[0]
ready

Revisions

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