Script Preparation code:
x
 
function makeid(length) {
    let result = '';
    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ';
    const charactersLength = characters.length;
    let counter = 0;
    while (counter < length) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
      counter += 1;
    }
    return result;
}
var data = Array(10000).fill(Array(40).fill(makeid(1000)))   
var rows = []
var row = {}
Tests:
  • no

     
    data.forEach((items) => {items.forEach((item,i)=>{row[i] = item}); rows.push(row)})
  • normalize

     
    data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.normalize()}); rows.push(row)})
  • trim

     
    data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.trim()}); rows.push(row)})
  • both 1

     
    data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.normalize().trim()}); rows.push(row)})
  • both 2

     
    data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.trim().normalize()}); rows.push(row)})
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    no
    normalize
    trim
    both 1
    both 2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Windows
View result in a separate tab
Test name Executions per second
no 50.4 Ops/sec
normalize 3.0 Ops/sec
trim 37.0 Ops/sec
both 1 3.0 Ops/sec
both 2 3.0 Ops/sec