| Crates.io | flexint |
| lib.rs | flexint |
| version | 0.1.0 |
| created_at | 2024-04-13 19:25:01.640471+00 |
| updated_at | 2024-04-13 19:25:01.640471+00 |
| description | Big integer types, optimized for small values |
| homepage | |
| repository | https://github.com/wleslie/flexint |
| max_upload_size | |
| id | 1207784 |
| size | 28,120 |
For applications in which numbers are usually small and only occasionally big, this crate's
FlexUint and FlexInt may enable better performance than the num-bigint crate's BigUint and
BigInt types, which involve unconditional heap allocation for all values regardless of magnitude.
One (admittedly dodgy) benchmark showed a 458% speedup in FlexInt compared to BigInt when adding
small values, while only introducing a 39% slowdown for big values.
serde: provides implementations of serde::Serialize and serde::Deserialize for FlexUint
and FlexInt.