property deletion

Benchmark created on


Description

remove several large-value keys from a list of objects

Setup

const objList = [];


for (let o = 0; o < 1000; o++) {
	let obj = {foo: 'bar', fuzz: 'baz'}
  for (let i = 0; i < 10; i++) {
  	obj[`key_${i}`] = Array.from({length: 2000}, () => Math.floor(Math.random() * 40))
  }	
  objList.push(obj)
}

Test runner

Ready to run.

Testing in
TestOps/sec
loop del
for (let i of objList) {
  for (let z=0; z<10; z++) { delete i[`key_${z}`] }
}
ready
copyout
const fuzz = [];

for (let i of objList) {
	fuzz.push({foo: i.foo, bar: i.bar})
}
ready

Revisions

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