Add from_reader and use Read internally to improve the codegen of deku,
the performance of derived parsers. Internally, this is implemented
using the new src/reader.rs interface in deku parses. This has a waterfall
effect on DekuReader implementations and the deku-derive/deku_read Derived impl.
Previous usage with from_bytes and other API's are unchanged.
There is somewhat of a performance hit for bit-only parses,
but I find the major improvments in the bytes-wise parsing to be great enough
to warrent this change.
The following are some sample benchmarks:
> critcmp before after
group after before
----- ----- ------
deku_read_bits 1.24 845.8±14.29ns ? ?/sec 1.00 679.5±11.83ns ? ?/sec
deku_read_byte 1.00 17.8±0.25ns ? ?/sec 2.12 37.8±3.35ns ? ?/sec
deku_read_enum 1.00 15.3±0.15ns ? ?/sec 2.04 31.2±0.81ns ? ?/sec
deku_read_vec 1.00 676.8±7.04ns ? ?/sec 2.16 1459.5±40.22ns ? ?/sec
deku_write_bits 1.00 125.3±3.10ns ? ?/sec 1.04 130.2±11.12ns ? ?/sec
deku_write_byte 1.00 161.6±4.86ns ? ?/sec 1.02 165.0±5.91ns ? ?/sec
deku_write_enum 1.00 105.6±1.06ns ? ?/sec 1.03 109.0±7.20ns ? ?/sec
deku_write_vec 1.00 4.6±0.04µs ? ?/sec 1.06 4.9±0.07µs ? ?/sec
The above change removes DekuRead, and replaces it with DekuReader. This contains
the from_reader_with_ctx. DekuContainerRead contains from_reader.
The crate no_std_io was picked to supply a Read impl
for the no_std feature. These are "re-export"ed.
Add "`Read` enabled" docs to lib.rs
Add tests/test_tuple.rs tests
Update CHANGELOG.md to reflect changes and help migration to this usage
Use llvm-cov in ci for the generation of more accurate coverage reports
Update benchmarks to test more complex parser speeds
Disable Miri CI
Update ensure_no_std to work with new Read usage. Remove wee-alloc in favour
of an updated crate for the allocator.
Add inline to small functions