Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
new vs not
(version: 1)
Comparing performance of:
native split vs class split vs string split
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
class MyString { #value = '' constructor(value) { this.#value = value } split(char) { return this.#value.split(char) } }
Tests:
native split
'/path/to/success?is=great'.split('?')
class split
new MyString('/path/to/success?is=great').split('?')
string split
new String('/path/to/success?is=great').split('?')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
native split
class split
string split
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Browser/OS:
Chrome 118 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
native split
20673958.0 Ops/sec
class split
19480692.0 Ops/sec
string split
9840988.0 Ops/sec
Related benchmarks:
Class instance
String _.split vs split
Object.defineProperty vs assignment
String Split Test
.endsWith vs last char
array.join vs string literal
String Constructor vs toString
class getter/setter vs property
slice vs substring vs [] vs charAt vs charCodeAt
Comments
Confirm delete:
Do you really want to delete benchmark?