Commit c296099
read_bytes(): use previous implementation again for small reads
For small reads, the new code that tries to avoid unnecessary reads is
noticeably slower than the previous code that reads unconditionally. In
the worst case (1-byte reads), the new code is 13 times as slow as the
previous implementation. The potential memory/IO savings only become
worth it for larger reads, where the performance difference disappears.
Co-authored-by: Petr Pucil <petr.pucil@seznam.cz>1 parent 255f5b7 commit c296099
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
307 | 316 | | |
308 | 317 | | |
309 | 318 | | |
| |||
0 commit comments