dermesser / integer-encoding-rs

Integer encoding for primitive integer types: Supports varint/varint+zigzag and fixed-length integer encoding and decoding, and provides synchronous and asynchronous Write/Read types for easily writing/reading integers.
Other
66 stars 16 forks source link

!assert in encode_var #38

Closed cemoktra closed 3 months ago

cemoktra commented 3 months ago

I would suggest replacing !assert with !debug_assert in those places, as the call to required_space has a huge impact on performance:

image

dermesser commented 3 months ago

that's true, we can rely on the bounds checking when writing to dst.