Commit d4db26c
⚡ Bolt: [optimize Levenshtein distance array initialization]
Replaced the `for` loop initialization of the cache array in the Levenshtein distance function with `iter_mut().enumerate().for_each()`.
The traditional `for` loop overhead in this tight loop is noticeable. Utilizing the internal `.for_each()` allows LLVM to better optimize the initialization phase.
Expecting a measurable performance improvement in the execution of the `levenshtein` function (based on a focused micro-benchmark).
Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>1 parent 43c970d commit d4db26c
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| |||
0 commit comments