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
Go 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
native split
20.7M/s
class split
19.5M/s
string split
9.8M/s
View exact numbers
Test name
Executions per second
✓
native split
20,673,958 Ops/sec
class split
19,480,692 Ops/sec
string split
9,840,988 Ops/sec
Related benchmarks
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?