String slice vs String substring

Benchmark created on


Setup

const string = 'abcde4941338484aae1ad9425b8abcde'
const half = string.length / 2

Test runner

Ready to run.

Testing in
TestOps/sec
Slice
const left = string.slice(0, half)
const right = string.slice(half)
ready
Substring
const left = string.substring(0, half)
const right = string.substring(half)
ready

Revisions

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