sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.05k stars 54 forks source link

Reduce calls to bivec.domain().region() #334

Closed wcampbell0x2a closed 1 year ago

wcampbell0x2a commented 1 year ago

This isn't as much as a performance gain as I thought it would be (around %2), but an improvement neverless.

github-actions[bot] commented 1 year ago

Benchmark for 3d10b43

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | deku_read_bits | **612.1±0.49ns** | 614.9±0.63ns | **+0.46%** | | deku_read_byte | 17.9±0.13ns | 18.0±0.12ns | +0.56% | | deku_read_enum | 31.5±0.15ns | **31.3±0.16ns** | **-0.63%** | | deku_read_vec | **1489.4±11.07ns** | 1503.2±11.17ns | **+0.93%** | | deku_read_vec_perf | 1509.6±8.07ns | **1490.2±12.53ns** | **-1.29%** | | deku_write_bits | 113.2±0.35ns | **111.0±0.27ns** | **-1.94%** | | deku_write_byte | 65.4±0.19ns | **65.1±0.16ns** | **-0.46%** | | deku_write_enum | 112.9±0.55ns | **111.6±0.24ns** | **-1.15%** | | deku_write_vec | 5.1±0.02µs | 5.1±0.02µs | 0.00% | | deku_write_vec_perf | 5.3±0.01µs | **5.0±0.02µs** | **-5.66%** |