Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash camelCase vs javascript camelCase long (+regex)
(version: 3)
Comparing performance of:
lodash vs javascript vs javascript with regex
Created:
one year ago
by:
Registered User
Go to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
var str = 'live_dlick_product_caunt_blias'
Tests:
lodash
_.camelCase(str)
javascript
str.toLowerCase().split("-").map((word, idx) => idx ? `${word[0].toUpperCase()}${word.substring(1)}` : word).join("");
javascript with regex
str.toLowerCase().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
lodash
javascript
javascript with regex
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
javascript
12.7M/s
javascript with regex
2.0M/s
lodash
1.5M/s
View exact numbers
Test name
Executions per second
✓
javascript
12,688,132 Ops/sec
javascript with regex
1,954,517 Ops/sec
lodash
1,509,538 Ops/sec
Related benchmarks
Lodash startCase vs Native
lodash camelCase vs javascript camelCase long
Javascript: Case insensitive string comparison performance inc. regex
lodash camelCase vs javascript regex with predefined regex
lodash camelCase vs javascript snake to camelcase only using regex
regex vs javascript camelCase long
Comments
Confirm delete:
Do you really want to delete benchmark?