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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
classnames with array and multiple objects
3515868.0 Ops/sec
classnames with multiple params and and multiple objects
4128197.0 Ops/sec
classnames with multiple params and single object
4305848.0 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 } )