Commit f94d18c
authored
[mypyc] Faster vec init and extend with bytes arguments (#21355)
Special case `vec[u8](<bytes>)` and `extend(<vec_u8>, <bytes>)`. These
are expected to be common operations and the specialization makes them
significantly faster with short `bytes` objects.
Existing test coverage is sufficient. I used microbenchmarks to check
that the performance impact is non-trivial.1 parent 38c3fcb commit f94d18c
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
144 | 156 | | |
145 | 157 | | |
146 | 158 | | |
| |||
443 | 455 | | |
444 | 456 | | |
445 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
446 | 465 | | |
447 | 466 | | |
448 | 467 | | |
| |||
0 commit comments