The goal of these benchmarks is to provide thorough and complete benchmarks for various rust serialization frameworks.
These benchmarks are still being developed and pull requests to improve benchmarks are welcome.
Calculate the number of messages per second that can be sent/received with various rust serialization frameworks and compression libraries. Documentation
All tests benchmark the following properties (time or size):
- Serialize: serialize data into a buffer
- Deserialize: deserializes a buffer into a normal rust object
- Size: the size of the buffer when serialized
- Zlib: the size of the buffer after zlib compression
- Zstd: the size of the buffer after zstd compression
- Zstd Time: the time taken to compress the serialized buffer with zstd
Zero-copy deserialization libraries have an additional set of benchmarks:
- Access: accesses a buffer as structured data
- Read: runs through a buffer and reads fields out of it
- Update: updates a buffer as structured data
Some benchmark results may be italicized and followed by an asterisk. Mouse over these for more details on what situation was benchmarked. Other footnotes are located at the bottom.
Runtime info
rustc 1.77.2 (25ef9e3d8 2024-04-09)
binary: rustc
commit-hash: 25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04
commit-date: 2024-04-09
host: aarch64-apple-darwin
release: 1.77.2
LLVM version: 17.0.6
This data set is composed of HTTP request logs that are small and contain many strings.
For operations, time per iteration; for size, bytes. Lower is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 370.34 µs | 1.1861 ms | 724953 | 302399 | 253747 | 2.3519 ms |
postcard_forth 0.1.0 | 250.77 µs | 1.0742 ms | 724953 | 302399 | 253747 | 2.4021 ms |
Crate | Access | Read | Update |
---|
Relative to best. Higher is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 67.71% | 90.57% | 100.00% | 100.00% | 100.00% | 100.00% |
postcard_forth 0.1.0 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 97.91% |
Crate | Access | Read | Update |
---|
This data set is a single mesh. The mesh contains an array of triangles, each of which has three vertices and a normal vector.
For operations, time per iteration; for size, bytes. Lower is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 328.78 µs | 1.2508 ms | 6000003 | 5378495 | 5345900 | 6.4919 ms |
postcard_forth 0.1.0 | 391.09 µs | 705.90 µs | 6000003 | 5378495 | 5345900 | 6.4544 ms |
Crate | Access | Read | Update |
---|
Relative to best. Higher is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 100.00% | 56.44% | 100.00% | 100.00% | 100.00% | 99.42% |
postcard_forth 0.1.0 | 84.07% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% |
Crate | Access | Read | Update |
---|
This data set is composed of Minecraft player saves that contain highly structured data.
For operations, time per iteration; for size, bytes. Lower is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 363.80 µs | 1.0675 ms | 367489 | 221913 | 207344 | 1.7195 ms |
postcard_forth 0.1.0 | 244.14 µs | 920.09 µs | 367489 | 221913 | 207344 | 1.7180 ms |
Crate | Access | Read | Update |
---|
Relative to best. Higher is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 67.11% | 86.19% | 100.00% | 100.00% | 100.00% | 99.91% |
postcard_forth 0.1.0 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% |
Crate | Access | Read | Update |
---|
This data set is composed of mk48.io game updates that contain data with many exploitable patterns and invariants.
For operations, time per iteration; for size, bytes. Lower is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 1.1626 ms | 2.3392 ms | 1279599 | 1058243 | 1016738 | 5.1470 ms |
postcard_forth 0.1.0 | 674.91 µs | 1.5785 ms | 1279599 | 1058243 | 1016738 | 5.1563 ms |
Crate | Access | Read | Update |
---|
Relative to best. Higher is better.
Crate | Serialize | Deserialize | Size | Zlib | Zstd | Zstd Time |
---|---|---|---|---|---|---|
postcard 1.0.8 | 58.05% | 67.48% | 100.00% | 100.00% | 100.00% | 100.00% |
postcard_forth 0.1.0 | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 99.82% |
Crate | Access | Read | Update |
---|
* mouse over for situational details
† do not provide deserialization capabilities, but the user can write their own
‡ do not support buffer mutation (capnp
and flatbuffers
may but not for rust)