Test name | Executions per second |
---|---|
Array.from | 248150.9 Ops/sec |
Spread | 269386.2 Ops/sec |
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);
const segments1Length = Array.from(segments1).length;
const segments2Length = Array.from(segments2).length;
const segments3Length = Array.from(segments3).length;
const segments1Length = [segments1].length;
const segments2Length = [segments2].length;
const segments3Length = [segments3].length;