Skip to content

Instantly share code, notes, and snippets.

@indutny
Created January 25, 2023 06:50
Show Gist options
  • Save indutny/3f87a256eb77eac4a8b5f5f26458c991 to your computer and use it in GitHub Desktop.
Save indutny/3f87a256eb77eac4a8b5f5f26458c991 to your computer and use it in GitHub Desktop.
V8 Benchmark for Intl.Segmenter#segment() improvements
const s = new Intl.Segmenter();
const input = 'a'.repeat(100 * 1024);
console.time('segment');
for (const _ of s.segment(input)) {}
console.timeEnd('segment');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment