Script Preparation code:
x
 
function makeid() {
    var text = "";
    var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    for (var i = 0; i < 5; i++)
        text += possible.charAt(Math.floor(Math.random() * possible.length));
    return text;
}
window.parentObj = {};
for (let i = 0; i < 100; i++) {
    window.parentObj[makeid()] = {
        innerVal: makeid()
    };
}
Tests:
  • entries

     
    const newObj = {};
    Object.entries(window.parentObj).forEach(([k, v], i) => {
      if ((i % 2) === 0) {
        newObj[k] = v;    
      }
    });
  • keys

     
    const newObj = {};
    Object.keys(window.parentObj).forEach((k, i) => {
      if ((i % 2) === 0) {
        newObj[k] = window.parentObj[k];    
      }
    });
  • values

     
    const newObj = {};
    Object.values(window.parentObj).forEach((k, i) => {
      if ((i % 2) === 0) {
        newObj[k] = window.parentObj[k];    
      }
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    entries
    keys
    values

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Firefox 82 on Windows
View result in a separate tab
Test name Executions per second
entries 61798.1 Ops/sec
keys 46348.5 Ops/sec
values 33684.1 Ops/sec