Delete performance

Benchmark created on


Setup

class Foo {
	constructor(name) {
		this.name = name
	}
	
	bar() {}
}

let list = [
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance"),
	new Foo("MyInstance")
]

const set = new Set(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'])

Test runner

Ready to run.

Testing in
TestOps/sec
delete from array
list.splice(4,1)
ready
delete via filter
list.filter((_, idx) => idx !== 4)
ready
delete from set
set.delete('e')
ready

Revisions

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