Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Classnames vs CLSX vs light-classnames on string concatenation
In doing my new package light-classnames. I'm trying to see if my package is faster than the other two major competitors/
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
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:
Safari 26
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
4 months ago
light-classnames
217.0M/s
clsx
105.8M/s
classnames
36.8M/s
View exact numbers
Test name
Executions per second
✓
light-classnames
216,996,384 Ops/sec
clsx
105,812,160 Ops/sec
classnames
36,831,740 Ops/sec
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)