Script Preparation code:
AخA
 
var data = [{
        calendar: [{
                id: 1,
                name: "Calendar 1",
            },
            {
                id: 2,
                name: "Calendar 2",
            }
        ]
    },
    {
        calendar: [{
            id: 3,
            name: "Calendar 3",
        }, ]
    },
    {
        calendar: [{
                id: 4,
                name: "Calendar 4",
            },
            {
                id: 5,
                name: "Calendar 5",
            }
        ]
    }
];
Tests:
  • Push

     
    var calendars = [];
    data.forEach(d => calendars.push(...d.calendar));
  • Reduce

     
    var calendars = data.reduce((acc, cur) => [...acc, ...cur.calendar], []);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Push
    Reduce

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Push 9977612.0 Ops/sec
Reduce 9934412.0 Ops/sec