Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Classnames vs CLSX vs light-classnames on string concatenation
(version: 1)
In doing my new package light-classnames. I'm trying to see if my package is faster than the other two major competitors/
Comparing performance of:
classnames vs clsx vs light-classnames
Created:
10 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/classnames/2.2.6/index.min.js"></script> <script src="https://unpkg.com/clsx@1.1.0/dist/clsx.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/light-classnames@0.0.3/dist/bundle.umd.min.js"></script>
Script Preparation code:
var str = 'style'; var obj = { 'style-2': true, 'style-3': false, 'style-4': 9, 'style-5': null }; var number = 6; var anotherStr = 'jigucha'; var moreObject = {a: undefined, b: 'asdf'}
Tests:
classnames
let result = window.classNames(str, anotherStr)
clsx
let result = window.clsx(str, anotherStr)
light-classnames
let result = window.lcn(str, anotherStr)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
classnames
clsx
light-classnames
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3.1 Safari/605.1.15
Browser/OS:
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
classnames
36831740.0 Ops/sec
clsx
105812160.0 Ops/sec
light-classnames
216996384.0 Ops/sec
Related benchmarks:
Classnames vs CLSX vs ClassD vs Alternatives
Classnames 2.3.1 vs CLSX 1.1.1 vs Alternatives
clsx string vs array vs object
Classnames vs CLSX vs Template Literals 2/28/2023
Classnames vs CLSX vs Alternatives (2)
Classnames vs CLSX vs Alternatives (Nov 27, 2023)
Classnames vs CLSX vs Alternatives 03.25.2024
Classnames vs CLSX vs Alternatives 2024-05-20
Classnames vs CLSX vs Alternatives - flat array
Comments
Confirm delete:
Do you really want to delete benchmark?