issues
search
sharksforarms
/
deku
Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.14k
stars
55
forks
source link
Add ByteSize impl for CString
#497
Closed
wcampbell0x2a
closed
3 weeks ago
wcampbell0x2a
commented
3 weeks ago
Use the new dynamic bytes attribute to apply to CString, which in many protocols you already have the size of the CString, so might as well use it
github-actions[bot]
commented
3 weeks ago
Benchmark for e130d8d
Click to view benchmark
| Test | Base | PR | % | |------|--------------|------------------|---| | count_from_u8_specialize | **98.7±0.63ns** | 100.1±5.48ns | **+1.42%** | | count_no_specialize | **2.4±0.02µs** | 2.6±0.02µs | **+8.33%** | | count_specialize | **100.0±0.67ns** | 100.9±1.74ns | **+0.90%** | | deku_read_bits | 1175.5±21.31ns | **1127.4±13.80ns** | **-4.09%** | | deku_read_byte | 4.9±0.05ns | **4.6±0.05ns** | **-6.12%** | | deku_read_enum | 4.1±0.06ns | **3.8±0.08ns** | **-7.32%** | | deku_read_vec | **30.2±0.31ns** | 31.4±0.50ns | **+3.97%** | | deku_write_bits | **189.8±6.24ns** | 198.8±8.03ns | **+4.74%** | | deku_write_byte | 25.8±0.38ns | 25.8±0.43ns | 0.00% | | deku_write_enum | 23.9±0.39ns | 24.1±1.30ns | +0.84% | | deku_write_vec | 437.2±5.52ns | 433.4±13.06ns | -0.87% | | read_all | **4.3±0.07µs** | 5.0±0.04µs | **+16.28%** | | read_all_bytes | 4.8±0.11µs | **4.3±0.04µs** | **-10.42%** |
github-actions[bot]
commented
3 weeks ago
Benchmark for c01eb5b
Click to view benchmark
| Test | Base | PR | % | |------|--------------|------------------|---| | count_from_u8_specialize | 115.2±1.16ns | **91.2±1.58ns** | **-20.83%** | | count_no_specialize | **2.5±0.05µs** | 2.6±0.01µs | **+4.00%** | | count_specialize | 102.5±1.26ns | **96.8±1.30ns** | **-5.56%** | | deku_read_bits | **1163.9±9.14ns** | 1174.8±23.60ns | **+0.94%** | | deku_read_byte | 4.5±0.04ns | 4.5±0.06ns | 0.00% | | deku_read_enum | 3.8±0.07ns | 3.8±0.06ns | 0.00% | | deku_read_vec | 47.1±0.89ns | **30.1±0.19ns** | **-36.09%** | | deku_write_bits | **187.4±5.62ns** | 209.7±7.88ns | **+11.90%** | | deku_write_byte | 26.1±0.43ns | 26.1±0.40ns | 0.00% | | deku_write_enum | 23.9±0.41ns | 23.9±0.40ns | 0.00% | | deku_write_vec | 449.4±7.82ns | **431.0±4.73ns** | **-4.09%** | | read_all | 5.0±0.02µs | 5.0±0.03µs | 0.00% | | read_all_bytes | 5.1±0.29µs | **4.2±0.03µs** | **-17.65%** |