#tlv #parser #performance

no-std tlv-rs

A parser for SIMPLE TLVs

7 releases

0.2.4 Jan 6, 2024
0.2.3 Jan 5, 2024
0.2.2 Nov 7, 2023
0.2.1 Sep 3, 2023
0.1.2 Jun 16, 2023

#7 in #tlv

Download history 15/week @ 2024-07-29 20/week @ 2024-08-05 48/week @ 2024-08-12 1048/week @ 2024-08-19 1792/week @ 2024-08-26 2540/week @ 2024-09-02 1501/week @ 2024-09-09 2067/week @ 2024-09-16 1410/week @ 2024-09-23 978/week @ 2024-09-30 1228/week @ 2024-10-07 741/week @ 2024-10-14 1155/week @ 2024-10-21 1253/week @ 2024-10-28 1517/week @ 2024-11-04

4,759 downloads per month
Used in 2 crates

MIT/Apache

15KB
195 lines

tlv-rs

A minimal parser for SIMPLE TLVs.

no_std

This crate requires allocations, because of the Cow type.

Performance

On my 12th Gen Intel 1240p Framework laptop the following speeds were achieved.

-- ns/iter
read_tlv 1.37
write_tlv 2.98

A note on throughput

Since the implementation only parses the header and stores the body, as a slice, all read operations are $O(1)$ and all writes $O(n)$.

Panics

In the no_panic example all functions, except for to_bytes_dynamic since it allocates and can therefore panic, are proven to never panic.

Dependencies

~0.9–1.4MB
~30K SLoC