Script Preparation code:
Tests:
  • while (array.length > 0) { array.pop(); }

  • while (array.pop()) {}

  • array.length = 0;

  • array = [];

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    while (array.length > 0) { array.pop(); }
    while (array.pop()) {}
    array.length = 0;
    array = [];

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 2024 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36
Chrome 62 on Windows
View result in a separate tab
Test name Executions per second
while (array.length > 0) { array.pop(); } 7517485.0 Ops/sec
while (array.pop()) {} 7453645.0 Ops/sec
array.length = 0; 4427535.0 Ops/sec
array = []; 5202380.0 Ops/sec