Repository navigation
promote countGraphemes() to a fast path - #140
Conversation
🦋 Changeset detectedLatest commit: 3d31a70 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 improve performance by ×2.3
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | countGraphemes - Code snippet (combined) |
158 µs | 41.8 µs | ×3.8 |
| ⚡ | countGraphemes - Tweet text (combined) |
78.3 µs | 27.3 µs | ×2.9 |
| ⚡ | countGraphemes - Lorem ipsum (ascii) |
58.3 µs | 21.8 µs | ×2.7 |
| ⚡ | countGraphemes - Hindi |
55 µs | 24.8 µs | ×2.2 |
| ⚡ | countGraphemes - Emojis |
31.5 µs | 18.3 µs | +71.51% |
| ⚡ | countGraphemes - Demonic characters |
39.2 µs | 32.3 µs | +21.24% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fast-counter-path (3d31a70) with main (2ac327c)2
Footnotes
-
12 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(b1a0807) during the generation of this report, so 2ac327c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
|
Since If a new function based on an array buffer were added, it could perform about 2x as fast on small text, so it is worth considering providing this as an additional API. e.g. Which is actually the most used one I guess. |
countGraphemes() as fast path
countGraphemes() as fast pathcountGraphemes() to a fast path
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 940 973 +33
=========================================
+ Hits 940 973 +33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
No description provided.