add collectGraphemes() as a fast method#141
Conversation
🦋 Changeset detectedLatest commit: 133edc6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
splitGraphemesToArray() as a fast methodcollectGraphemes() as a fast method
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #141 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 973 1033 +60
=========================================
+ Hits 973 1033 +60 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Building a grapheme array is the most common use case for this library.
Added a new method to its direct path. It directly assigns a segment of text to a buffer to avoid extra overhead from the generator/iterator protocol.
It's 2-4x faster than the generator version. But it may consume memory too eagerly with large input.