Script Preparation code:
x
 
var voucher = {
    "single": false,
    "applyOverTaxes": false,
    "discountType": "1",
    "value": 100,
    "minimumAmount": 0,
    "quantity": 1,
    "suffixLength": 8,
    "code": "IF5R0AFX",
    "vertical": [],
    "allowedPaymentMethods": [],
    "allowedBanks": [],
    "types": [],
    "partners": [],
    "startDate": "2020-10-21T00:00:00.000Z",
    "endDate": "2020-10-21T00:00:00.000Z",
    "applyed": false
}
Tests:
  • window.structuredClone

     
    const copy = window.structuredClone(voucher);
  • Spread syntax

     
    const copy = { ...voucher };
  • Object assign

     
    const copy = {};
    Object.assign(copy, voucher)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    window.structuredClone
    Spread syntax
    Object assign

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Firefox 122 on Windows
View result in a separate tab
Test name Executions per second
window.structuredClone 567692.6 Ops/sec
Spread syntax 7433920.0 Ops/sec
Object assign 27664068.0 Ops/sec