jsx attrs

Benchmark created on


Setup

const attrs = {
	src: './index.js',
	'data-rcid': '123',
};

let result;

Teardown

console.log(result);

Test runner

Ready to run.

Testing in
TestOps/sec
1
result = Object.entries(attrs)
	.map(([key, value]) => `${key}="${value}"`)
	.join(' ');
ready
2
result = Object.keys(attrs)
	.reduce((acc, key) => `${acc} ${key}="${attrs[key]}"`, '');
ready

Revisions

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