edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! bench: zlib inflate rows for lanes/bench.md ("lane benchrest"). |
| 2 | //! |
| 3 | //! usage: |
| 4 | //! bench zlib <in.zlib> <out.bin> [reps] |
| 5 | //! bench blocks <in.blocks> <out.bin> [reps] |
| 6 | //! |
| 7 | //! `zlib` inflates one zlib stream with `inflate_zlib`, `reps` times (default 5), and keeps the |
| 8 | //! best wall time. `blocks` reads a sequence of `[u32 little-endian length][zlib stream]` records |
| 9 | //! (one per subtitle-sized packet) and inflates every record with `inflate_zlib`, timing the whole |
| 10 | //! loop. Both write the concatenated output of the last pass to `<out.bin>`, untimed, for the md5 |
| 11 | //! check against python's `zlib.decompress`. |
| 12 | use black_box; |
| 13 | use Instant; |
| 14 | |
| 15 | /// Output ceiling passed to every call: far above the inputs used here, but not "no ceiling". |
| 16 | const LIMIT: usize = 1 << 30; |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 |