Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
clsx vs cx
(version: 0)
Benchmark.js
Comparing performance of:
clsx vs cx
Created:
3 years ago
by:
Guest
Go to the latest result
HTML Preparation code:
<script src='https://unpkg.com/clsx@1.1.0/dist/clsx.min.js'></script>
Tests:
clsx
var str = 'style'; var obj = { 'style-2': true, 'style-3': false, 'style-4': true, } var arr = ['style-5', 'style-6'] let result = window.clsx(str, obj, arr, 'test classname')
cx
var str = 'style'; var obj = [ true && 'style-2', false && 'style-3', true && 'style-4', ] var arr = ['style-5', 'style-6'] const cx = (...args) => args .flat() .filter(x => x !== null && x !== undefined && typeof x !== 'boolean' ).join(' ') let result = cx(str, obj, arr, 'test classname')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
clsx
cx
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 years ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser/OS:
Chrome 124 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
clsx
6.6M/s
cx
1.5M/s
View exact numbers
Test name
Executions per second
✓
clsx
6,578,232 Ops/sec
cx
1,515,056 Ops/sec
Related benchmarks
Classnames vs CLSX vs Alternatives
Classnames vs CLSX vs Alternatives 03.25.2024
Classnames vs CLSX vs custom
Comments
Confirm delete:
Do you really want to delete benchmark?