Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Classnames objects vs arrays
classnames objects vs arrays
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/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
classnames with multiple params and single object
4.2M/s
classnames with multiple params and and multiple objects
4.0M/s
classnames with array and multiple objects
3.5M/s
View exact numbers
Test name
Executions per second
✓
classnames with multiple params and single object
4,238,234 Ops/sec
classnames with multiple params and and multiple objects
3,962,286 Ops/sec
classnames with array and multiple objects
3,465,343 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/classnames/2.3.0/index.min.js'></script>
Script Preparation code:
var large = false var inHeader = true
Tests:
classnames with array and multiple objects
let result = window.classNames([ 'm-dots-menu', { 'm-dots-menu--large': large }, { 'm-dots-menu--header-actions': inHeader }, ])
classnames with multiple params and and multiple objects
let result = window.classNames( 'm-dots-menu', { 'm-dots-menu--large': large }, { 'm-dots-menu--header-actions': inHeader }, )
classnames with multiple params and single object
let result = window.classNames('m-dots-menu', { 'm-dots-menu--large': large , 'm-dots-menu--header-actions': inHeader } )