Script Preparation code:
AخA
 
var strings = {};
for (var i=0; i<1000; i++) {
  strings[i] = ""+i+i;
}
Tests:
  • USING MAP and JOIN

    x
     
    const URLS = [
      {
        "title": "USPS",
        "url": "https://tools.usps.com/go/TrackConfirmAction?tLabels="
      },
      {
        "title": "Parcels",
        "url": "https://parcelsapp.com/en/tracking/"
      },
      {
        "title": "EVEREST",
        "url": "http://everest.forwardex.com/m/track.asp?track="
      }
    ]
    URLS.map(url => `<a class="dropdown-item" href="${url.url + 'doc.tracking_number'}" target="_blank">${url.title}</a>`).join('');
  • USING REDUCE

     
    const URLS = [
      {
        "title": "USPS",
        "url": "https://tools.usps.com/go/TrackConfirmAction?tLabels="
      },
      {
        "title": "Parcels",
        "url": "https://parcelsapp.com/en/tracking/"
      },
      {
        "title": "EVEREST",
        "url": "http://everest.forwardex.com/m/track.asp?track="
      }
    ]
    const reduced_urls = URLS.reduce((acc, url) => {
      return acc + `<a class="dropdown-item" href="${url.url + 'doc.tracking_number'}" target="_blank">${url.title}</a>`;
    }, '');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    USING MAP and JOIN
    USING REDUCE

    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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Windows
View result in a separate tab
Test name Executions per second
USING MAP and JOIN 3634042.8 Ops/sec
USING REDUCE 15451975.0 Ops/sec