Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
string charAtCode vs char
(version: 1)
Benchmark.js
Comparing performance of:
chartCodeAt vs charAt
Created:
10 days ago
by:
Registered User
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const str = "this is big string"; function charCodeAt(){ return str.charCodeAt(5) === 'i' } function charAt(){ return str[5] === 'i' }
Tests:
chartCodeAt
charCodeAt();
charAt
charAt()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
chartCodeAt
charAt
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 days ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36
Browser/OS:
Chrome 152 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
charAt
1167.4M/s
chartCodeAt
1148.1M/s
View exact numbers
Test name
Executions per second
✓
charAt
1,167,363,968 Ops/sec
chartCodeAt
1,148,099,584 Ops/sec
Related benchmarks
JS string includes vs indexOf
String Constructor vs toString
Function vs () =>
Test AAAAA
Comments
Confirm delete:
Do you really want to delete benchmark?