Hello Rustaceans!
For the sad reasons that we all know, the bincode maintenance has officially ceased the development of the project (RUSTSEC-2025-0141). To support the growth of the rust open source ecosystem, we have forked and restart the development of bincode, with the fork been named as bincode-next. After several month of discussions and development, we are finally confirming the release of v3.0.0-rc.1. As this is only a release candidate release, so the api might be unstable. The main reason for the breaking is that we have updated our msrv policy to: msrv version = 1.(latest stable minor -3).(latest patch) which is a breaking change. But future msrv updates according to the new policy will not be seen as breaking again. Exclude this policy change, for as far as we can see, the api of the original part remains the same as bincode v2 (although the internal processing has changed much). To avoid the post become to length, we will only summarize the main changes.
New Features to Look at
- Nested Zero-copy support via Relative Pointers and Const Alignment (optional feature, using the
zerocopyfeature to enable) - Schema Fingerprinting for Safe Versioning (optional, using the
config::standard().with_fingerprint()with the derive macroFingerprintto enable) - Bit-level Packing for Space-Optimized Serialization (optional, using the
BitPackedderive macro with theconfig::standard().with_bit_packing()config to enable) - Compile-time Memory Bound Validation via Const Generics (optional feature, enable the
static-sizefeature to use it)
Internal Updates
- Reducing Binary Bloat via Error De-genericization (see the
error.rserror_path.rsand theerror_macro.rsfor details, but the public apis remains untouched) - Performance Boost via Several Optimization and Fix some Bugs in the Original bincode Implementation
TL;DR:Please visit the bincode-next Project Homepage for more detailed information.
git clone https://github.com/Apich-Organization/bincode.git
cd bincode
# We need root permission and use nightly compiler to ensure the most accurate result.
sudo cargo +nightly bench --bench extreme_perf
sudo cargo +nightly bench --bench complex
# But you could also run it without sudo and the nightly compiler, that do not effect much.
# cargo bench --bench extreme_perf
# cargo bench --bench complex
complex_world_decode/bincode-next (traits, varint)
time: [16.819 µs 16.878 µs 16.950 µs]
change: [−14.387% −12.575% −10.995%] (p = 0.00 < 0.05)
Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
3 (3.00%) low mild
4 (4.00%) high mild
8 (8.00%) high severe
complex_world_decode/bincode-next (traits, fixed)
time: [21.782 µs 21.872 µs 22.009 µs]
change: [−10.289% −9.7849% −9.2180%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) high mild
5 (5.00%) high severe
complex_world_decode/bincode-v2 (serde, varint)
time: [25.637 µs 25.727 µs 25.820 µs]
change: [−4.9126% −4.5062% −4.1169%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
complex_world_decode/bincode-v2 (serde, fixed)
time: [21.920 µs 21.973 µs 22.037 µs]
change: [−4.1017% −3.6962% −3.2912%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
complex_world_decode/bincode-v1 (serde)
time: [22.048 µs 22.074 µs 22.105 µs]
change: [−16.582% −15.877% −15.149%] (p = 0.00 < 0.05)
Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
5 (5.00%) high mild
7 (7.00%) high severe
complex_world_encode/bincode-next (traits, varint)
time: [3.3416 µs 3.3467 µs 3.3526 µs]
change: [−9.4844% −8.9459% −8.2847%] (p = 0.00 < 0.05)
Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
8 (8.00%) high mild
3 (3.00%) high severe
complex_world_encode/bincode-next (traits, fixed)
time: [2.9236 µs 2.9350 µs 2.9527 µs]
change: [−7.0516% −6.4181% −5.8909%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
complex_world_encode/bincode-v2 (serde, varint)
time: [4.2454 µs 4.2489 µs 4.2525 µs]
change: [−9.7050% −9.2041% −8.8004%] (p = 0.00 < 0.05)
Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
1 (1.00%) low severe
4 (4.00%) low mild
5 (5.00%) high mild
3 (3.00%) high severe
complex_world_encode/bincode-v2 (serde, fixed)
time: [3.3257 µs 3.3295 µs 3.3337 µs]
change: [−4.6908% −4.2786% −3.9410%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) low mild
1 (1.00%) high mild
3 (3.00%) high severe
complex_world_encode/bincode-v1 (serde)
time: [3.0716 µs 3.0767 µs 3.0823 µs]
change: [−6.0147% −5.6804% −5.3628%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
4 (4.00%) high mild
3 (3.00%) high severe
vec_u64_small_varint_decode/bincode-next (current)
time: [2.8170 µs 2.8256 µs 2.8365 µs]
change: [−17.956% −16.784% −15.682%] (p = 0.00 < 0.05)
Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
2 (2.00%) high mild
11 (11.00%) high severe
vec_u64_small_varint_decode/bincode-v2 (original)
time: [12.411 µs 12.450 µs 12.493 µs]
change: [−15.187% −14.115% −13.189%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) high mild
7 (7.00%) high severe
vec_u64_large_varint_decode/bincode-next (current)
time: [12.991 µs 13.062 µs 13.154 µs]
change: [−10.932% −9.9467% −9.0857%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe
vec_u64_large_varint_decode/bincode-v2 (original)
time: [17.398 µs 17.635 µs 17.898 µs]
change: [−3.7287% −2.8902% −1.8419%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
vec_u64_fixint_native_decode/bincode-next (current)
time: [1.8350 µs 1.8373 µs 1.8396 µs]
change: [−6.3092% −6.1285% −5.9622%] (p = 0.00 < 0.05)
Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
2 (2.00%) low severe
5 (5.00%) low mild
1 (1.00%) high mild
3 (3.00%) high severe
vec_u64_fixint_native_decode/bincode-v2 (original)
time: [10.104 µs 10.129 µs 10.170 µs]
change: [−4.6863% −4.3429% −4.0001%] (p = 0.00 < 0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
3 (3.00%) high severe
vec_u64_fixint_native_decode/bincode-v1
time: [7.5019 µs 7.5378 µs 7.5711 µs]
change: [+1.8251% +2.1775% +2.5445%] (p = 0.00 < 0.05)
Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
vec_u8_bulk_decode/bincode-next (current)
time: [160.22 ns 160.44 ns 160.67 ns]
change: [−2.5803% −2.3878% −2.1975%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
vec_u8_bulk_decode/bincode-v2 (original)
time: [273.32 ns 273.86 ns 274.50 ns]
change: [−4.2012% −3.7499% −3.3633%] (p = 0.00 < 0.05)
Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
5 (5.00%) low mild
2 (2.00%) high mild
7 (7.00%) high severe
vec_u8_bulk_decode/bincode-v1
time: [6.2752 µs 6.3070 µs 6.3441 µs]
change: [−13.013% −12.540% −11.983%] (p = 0.00 < 0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
Performance Comparison: Decoding
Baseline: bincode-next (traits, varint) at 16.878 µs
| Rank | Implementation | Interface | Int Encoding | Median Time | Relative Speed |
|---|---|---|---|---|---|
| 1 | bincode-next | traits | varint | 16.878 µs | 1.00x |
| 2 | bincode-next | traits | fixed | 21.872 µs | 1.30x |
| 3 | bincode-v2 | serde | fixed | 21.973 µs | 1.30x |
| 4 | bincode-v1 | serde | N/A | 22.074 µs | 1.31x |
| 5 | bincode-v2 | serde | varint | 25.727 µs | 1.52x |
Performance Comparison: Encoding
Baseline: bincode-next (traits, fixed) at 2.9350 µs
| Rank | Implementation | Interface | Int Encoding | Median Time | Relative Speed |
|---|---|---|---|---|---|
| 1 | bincode-next | traits | fixed | 2.9350 µs | 1.00x |
| 2 | bincode-v1 | serde | N/A | 3.0767 µs | 1.05x |
| 3 | bincode-v2 | serde | fixed | 3.3295 µs | 1.13x |
| 4 | bincode-next | traits | varint | 3.3467 µs | 1.14x |
| 5 | bincode-v2 | serde | varint | 4.2489 µs | 1.45x |
Efficiency Score: Combined Round-Trip Performance
Sum of Median Decode + Median Encode (Normalized to the fastest = 1.00x)
| Rank | Implementation | Interface | Int Encoding | Total Time | Efficiency Score |
|---|---|---|---|---|---|
| 1 | bincode-next | traits | varint | 20.225 µs | 1.00x |
| 2 | bincode-next | traits | fixed | 24.807 µs | 1.23x |
| 3 | bincode-v1 | serde | N/A | 25.151 µs | 1.24x |
| 4 | bincode-v2 | serde | fixed | 25.303 µs | 1.25x |
| 5 | bincode-v2 | serde | varint | 29.976 µs | 1.48x |
Vector u64 Decoding: Varint Performance
Contrasting small vs. large integer varint decoding.
| Dataset | Implementation | Median Time | Relative Speed |
|---|---|---|---|
| Small Varint | bincode-next (current) | 2.8256 µs | 1.00x |
| Small Varint | bincode-v2 (original) | 12.450 µs | 4.41x |
| Large Varint | bincode-next (current) | 13.062 µs | 1.00x |
| Large Varint | bincode-v2 (original) | 17.635 µs | 1.35x |
Vector u64 Decoding: Fixed Performance
Baseline: bincode-next (current) at 1.8373 µs
| Rank | Implementation | Median Time | Relative Speed |
|---|---|---|---|
| 1 | bincode-next (current) | 1.8373 µs | 1.00x |
| 2 | bincode-v1 | 7.5378 µs | 4.10x |
| 3 | bincode-v2 (original) | 10.129 µs | 5.51x |
Bulk u8 Decoding: Throughput Performance
Baseline: bincode-next (current) at 160.44 ns
| Rank | Implementation | Median Time | Relative Speed |
|---|---|---|---|
| 1 | bincode-next (current) | 160.44 ns | 1.00x |
| 2 | bincode-v2 (original) | 273.86 ns | 1.71x |
| 3 | bincode-v1 | 6307.00 ns | 39.31x |
About Security and Code Quality
For security issues, please visit the Security Team Homepage for more details on reporting.
All code tests passed miri and all main crate source code passed clippy without errors.
MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test --all-features --no-fail-fast
cargo clippy --all-features
We remain committed to code security and welcomed security reporting.
And please notice that contributors shall follow the community guide lines of bincode-next.
Links
Implementation Details and Development Status: GitHub Homepage
Discord Server: Discord Server
Official Website: Official Website
Yours faithfully,
Apich Organization Development Team
Note: We know that some community members think that this organization is somehow too heavily branded, but after the sad bincode event, we think that sometimes contribute under the name of a team is better. And although there aren’t that many people in our team, it is definitely not only a solo developer anyway.