Script Preparation code:
AخA
 
var arr = [];
var count = 100000;
for(var i = 0; i<count; i++)
{
  arr.push(i);
}
Tests:
  • set add

    x
     
    const folderSet = new Set()
      arr.forEach((f) => {
        folderSet.add(f)
      })
  • map

     
    const result = arr.map((f) => f)
    var end = [...new Set(result)]
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    set add
    map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
Chrome 78 on Mac OS X 10.15.1
View result in a separate tab
Test name Executions per second
set add 108.8 Ops/sec
map 103.0 Ops/sec