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/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
classnames
19632304.0 Ops/sec
clsx
51386524.0 Ops/sec
light-classnames
52652156.0 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)