This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
unicode-segmenter@0.4.0
Minor Changes
e2c9e1d: Optimize perf again ๐ฅ
It can be still getting faster, why not?
Through seriously thoughtful micro-optimizations, it has achieved performance improvements of up to ~30% (404ns -> 310ns) in the previously used simple emoji joiner test.
Now it use more realistic benchmark with various types of input text. In most cases, unicode-segmenter is 7~15 times faster than other competing libraries.
For example, here a Tweet-like text ChatGPT generated:
16d2028: - Fix Intl.Segmenter adapter type definitions to be 100% compatible with tslib
Implemented Intl.Segmenter.prototype.resolvedOptions.\
But since the locale matcher is environment-specific,
the adapter returns input locale as-is, or fallback to en.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
unicode-segmenter@0.4.0
Minor Changes
e2c9e1d: Optimize perf again ๐ฅ
It can be still getting faster, why not?
Through seriously thoughtful micro-optimizations, it has achieved performance improvements of up to ~30% (404ns -> 310ns) in the previously used simple emoji joiner test.
Now it use more realistic benchmark with various types of input text. In most cases,
unicode-segmenter
is 7~15 times faster than other competing libraries.For example, here a Tweet-like text ChatGPT generated:
And the result then:
ab6787b: Make the Intl adapter's type definitions compatible with the original
f974448: - Rename
searchGrapheme
tosearchGraphemeCategory
, and deprecated old one.Segmenter
definitions from grapheme module toGraphemeCategory
.SearchResult<T>
, andGraphemeSearchResult
defnitions which are identical toCategorizedUnicodeRange<T>
.dc62381: Add
takeCodePoint
util to avoid extraString.codePointAt()
Patch Changes
3ea5a2d: Optimized initial parsing time via compacting tables into JSON
See https://v8.dev/blog/cost-of-javascript-2019#json and https://youtu.be/ff4fgQxPaO0
16d2028: - Fix
Intl.Segmenter
adapter type definitions to be 100% compatible with tslibIntl.Segmenter.prototype.resolvedOptions
.\ But since the locale matcher is environment-specific, the adapter returns input locale as-is, or fallback toen
.