Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Classnames vs CLSX vs cx v2
Compare CLSX vs Classnames vs an simpliest implementation of creating a template string
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
classnames
5501915.0 Ops/sec
clsx
14447509.0 Ops/sec
cx
2760250.5 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.1/dist/clsx.min.js'></script> <script src="https://cdn.jsdelivr.net/npm/@emotion/css@11.13.4/dist/emotion-css.umd.min.js"></script>
Script Preparation code:
var c = { a: true, b: false, c: undefined, d: "lorem-ipsum" }; var someClasses = ['class1', true || 'class2', false && 'class3', true ? 'class4' : 'class5', c]
Tests:
classnames
let result = window.classNames(someClasses)
clsx
let result = window.clsx(someClasses)
cx
let result = window.emotion.cx(someClasses)