Commit 5d255b2
perf: optimize newline preservation using memchr
Replace byte-by-byte loops with efficient chunked filling:
- Use memchr::memchr2 to find newline positions
- Fill spaces in chunks between newlines using optimized fill()
- Preserves correctness while restoring performance
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent f40d55a commit 5d255b2
1 file changed
+26
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 232 | + | |
| 233 | + | |
238 | 234 | | |
239 | 235 | | |
240 | 236 | | |
241 | 237 | | |
242 | 238 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 239 | + | |
| 240 | + | |
249 | 241 | | |
250 | 242 | | |
251 | 243 | | |
252 | 244 | | |
253 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
254 | 268 | | |
255 | 269 | | |
256 | 270 | | |
| |||
0 commit comments