Incrementing properties (v2)

Revision 2 of this benchmark created on


Setup

var total = {count: 0}

const objectSpread = () => {
	return {...total, count: total.count + 1}
}

const mutate = () => {
	total.count += 1
	return total
}

var result = total

Test runner

Ready to run.

Testing in
TestOps/sec
Object spread
result = objectSpread()
ready
Property mutation w/reassignment
result = mutate()
ready
Property mutation, no reassignment
mutate()
ready

Revisions

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