Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Classnames vs CLSX vs cx
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/151.0.0.0 Safari/537.36 Edg/151.0.0.0
Browser:
Chrome 151
Operating system:
Windows
Device Platform:
Desktop
Date tested:
3 days ago
clsx
21.7M/s
classnames
10.0M/s
cx
3.8M/s
View exact numbers
Test name
Executions per second
✓
clsx
21,699,718 Ops/sec
classnames
9,965,592 Ops/sec
cx
3,751,614 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" };
Tests:
classnames
let result = window.classNames(c)
clsx
let result = window.clsx(c)
cx
let result = window.emotion.cx(c)