Object extension, incl. Vue

Benchmark created on


Preparation HTML

<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>

Setup

var root = new Vue();
var option = {};
for (var i = 0; i < 100; i++) {
	option[i] = {};
}
var options = {};
for (var i = 100; i < 200; i++) {
	options[i] = {};
}

Test runner

Ready to run.

Testing in
TestOps/sec
Object.entries
Object.entries(options).forEach(([key, value]) => {
	root.$set(option, key, value);
});
ready
Spread
option = {
	...option,
	...options,
}
ready

Revisions

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