Slice vs Substr vs Substring vs [ ] Methods (v23)

Revision 23 of this benchmark created by Alexander on


Description

This is comparing the runtimes of substr, substring, and slice in a string for large (66000 character) string size.

Setup

var str = "Hello World!";

Test runner

Ready to run.

Testing in
TestOps/sec
Substring
str.substring(1);
ready
substr
str.substr(1);
ready
slice
str.slice(1);
ready

Revisions

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