Script Preparation code:
โ€‹x
 
const segmenter = new Intl.Segmenter("ja", {granularity: "grapheme"});
โ€‹
const str1 = "๐ ฎท้‡Žๅฎถ";
const str2 = "๐Ÿ˜„๐Ÿ’ขโœ‹";
const str3 = "๐Ÿ‘จโ€ข๐Ÿ‘ฉโ€ข๐Ÿ‘งโ€ข๐Ÿ‘ฆ";
โ€‹
var segments1 = segmenter.segment(str1);
var segments2 = segmenter.segment(str2);
var segments3 = segmenter.segment(str3);
Tests:
  • Array.from

     
    const segments1Length = Array.from(segments1).length;
    const segments2Length = Array.from(segments2).length;
    const segments3Length = Array.from(segments3).length;
  • Spread

     
    const segments1Length = [...segments1].length;
    const segments2Length = [...segments2].length;
    const segments3Length = [...segments3].length;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.from
    Spread

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Chrome 127 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.from 248150.9 Ops/sec
Spread 269386.2 Ops/sec