Script Preparation code:
AخA
 
var set = new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]);
Tests:
  • Array from

     
    return Array.from(set);
  • Destructuring

     
    return [...set]
  • forEach

     
    let a = [];
    set.forEach(x => a.push(x));
    return a;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array from
    Destructuring
    forEach

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135 on Windows
View result in a separate tab
Test name Executions per second
Array from 29947180.0 Ops/sec
Destructuring 29028110.0 Ops/sec
forEach 7152086.5 Ops/sec