object creation

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
run 10k
const accent = 'hello';
const variant = 'world';

const res = [];

for (var i =0; i < 10000; i++) {
	const a = {
		'accent--default': !accent || accent === 'default',
            'accent--isHighlight': accent === 'highlight',
            'accent--isMuted': accent === 'muted',
            'accent--isSuccess': accent === 'success',
            'accent--isWarning': accent === 'warning',
            'accent--isInherit': accent === 'inherit',
            'variant--isInline': variant === 'inline',
            'variant--isOutline': variant === 'outline',
            'variant--isText': variant === 'text',
	};
	
	res.push(a)
}
ready
run 20k
const accent = 'hello';
const variant = 'world';

const res = [];

for (var i =0; i < 20000; i++) {
	const a = {
		'accent--default': !accent || accent === 'default',
            'accent--isHighlight': accent === 'highlight',
            'accent--isMuted': accent === 'muted',
            'accent--isSuccess': accent === 'success',
            'accent--isWarning': accent === 'warning',
            'accent--isInherit': accent === 'inherit',
            'variant--isInline': variant === 'inline',
            'variant--isOutline': variant === 'outline',
            'variant--isText': variant === 'text',
	};
	
	res.push(a)
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.