Commit 35aaad9
String mapi ~2.5x perf improvement (v2) (#9482)
* Move `String.length` to the top of its module so that the `length` function is in scope
* Using known length for mapping, and unrolling x2 to improve perf of String.mapi by 2.5x
* Fix two unapparent errors in the unroll loop, fix nit on parens
* Add String.mapi tests for all new unrolling corner cases, and some general ones
* Add side-effect test, this would fail if sequentiality of String.mapi is broken
* Remove "foo" from tests
* Remove unrolling of loop in String.mapi
Co-authored-by: Phillip Carter <pcarter@fastmail.com>1 parent 8e276dd commit 35aaad9
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | | - | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
0 commit comments