- Fix performance issues related to writing individual bytes instead of
using `Write::write_all`.
- Make manual implementations of `Encode` and `Decode` easier:
- Remove `encoded_len` method from `Encode`
- Split `Packet` trait into `EncodePacket` and `DecodePacket`.
- Simplify derive macros.
This PR also includes the Criterion benchmark.
## Before this commit
> Benchmarking BlockState::to_kind
> Benchmarking BlockState::to_kind: Warming up for 3.0000 s Benchmarking
BlockState::to_kind: Collecting 100 samples in estimated 20.045 s (273k
iterations) Benchmarking BlockState::to_kind: Analyzing
> BlockState::to_kind time: [68.925 µs 69.202 µs 69.477 µs]
>
> Found 5 outliers among 100 measurements (5.00%)
> 4 (4.00%) high mild
> 1 (1.00%) high severe
## After this commit
> Benchmarking BlockState::to_kind
> Benchmarking BlockState::to_kind: Warming up for 3.0000 s Benchmarking
BlockState::to_kind: Collecting 100 samples in estimated 20.010 s (3.8M
iterations) Benchmarking BlockState::to_kind: Analyzing
> BlockState::to_kind time: [1.5814 µs 1.5859 µs 1.5912 µs]
> change: [-97.692% -97.678% -97.666%] (p = 0.00 < 0.05)
> Performance has improved.
> Found 4 outliers among 100 measurements (4.00%)
> 4 (4.00%) high mild
Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>