Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
str.charAt(0).toLowerCase() vs str.toLowerCase()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
toLowerCase()
131.0M/s
str.charAt(0).toLowerCase()
71.8M/s
regExp
3.6M/s
View exact numbers
Test name
Executions per second
✓
toLowerCase()
131,007,616 Ops/sec
str.charAt(0).toLowerCase()
71,809,752 Ops/sec
regExp
3,647,146 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var str = 'myTestWord'
Tests:
str.charAt(0).toLowerCase()
str.charAt(2).toLowerCase() + str.slice(3);
toLowerCase()
str.slice(2,3).toLowerCase() + str.slice(3);
regExp
str.replace(/my(.)/, (s1, s2) => { return s2.toLowerCase()})