indexOf vs test

Benchmark created on


Setup

const source = {
	src: 'blob:http://www.blob.com'
}

Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
if (source.src.indexOf('blob') === 0) {
  URL.revokeObjectURL(source.src);
}
ready
RegEx test
if (/^blob:http/.test(source.src)) {
  URL.revokeObjectURL(source.src);
}
ready

Revisions

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