Commit d3577e3
committed
Add v3.0.0: Hierarchical break detection
Performance improvements:
- Words checked only at grapheme boundaries
- Sentences checked only at word boundaries
- Single UTF-8 decode and classification pass
- Pre-classified data reused across all break types
Benchmark results (Apple M4 Pro):
- Short text: 1.57x faster (3,457ns → 2,197ns)
- Medium text: 1.68x faster (16,191ns → 9,636ns)
- Long text: 2.24x faster (423,491ns → 188,982ns)
Speedup increases with text length due to hierarchical pruning.
Maintains 100% Unicode conformance:
- Grapheme: 766/766 tests
- Word: 1,944/1,944 tests
- Sentence: 512/512 tests1 parent 539a623 commit d3577e3
3 files changed
+1313
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
259 | 295 | | |
260 | 296 | | |
261 | 297 | | |
| |||
0 commit comments