For...of Caching

Benchmark created on


Setup

let start = new Set([1,2,"dwdawd",{a:2,b:2},[2,3,"dwd"]])

Test runner

Ready to run.

Testing in
TestOps/sec
Normal
let trash=[];
for(let item of start.values()){
	trash.push(item)
}

ready
Cachced
let trash=[];
let item, vals=start.values();
for(item of vals){
	trash.push(item)
}
ready

Revisions

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