Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Cache toLowerCase() for string compare
(version: 2)
Comparing performance of:
lowerCase vs cache vs cache Indexed vs input
Created:
3 months ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var input = "Hello" var value = input.toLowerCase() var variable0 = "heLLo"; var variable1 = "Hell0"; var cache0 = variable0.toLowerCase() var cache1 = variable1.toLowerCase() var cache = { variable0: variable0.toLowerCase(), variable1: variable1.toLowerCase() }
Tests:
lowerCase
value == variable0.toLowerCase() value == variable1.toLowerCase()
cache
value == cache0 value == cache1
cache Indexed
value == cache.variable0 value == cache.variable1
input
input.toLowerCase() == variable0.toLowerCase() input.toLowerCase() == variable1.toLowerCase()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
lowerCase
cache
cache Indexed
input
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
lowerCase
155903920.0 Ops/sec
cache
153746672.0 Ops/sec
cache Indexed
158372224.0 Ops/sec
input
155742496.0 Ops/sec
Related benchmarks:
Javascript: Case insensitive string comparison performance
case insensitive comparison
Javascript: Case insensitive string comparison performance lowerLocale
Javascript: Case insensitive string comparison performance 2
Javascript: Case insensitive string comparison performance en-US
string comparison bnchmk 1
Case insensitive string comparison: toLowerCase vs localeCompare vs toUpperCase
Javascript: Case insensitive string comparison performance inc. regex
Javascript: Case insensitive string comparison performance2
Comments
Confirm delete:
Do you really want to delete benchmark?