DEV Community 👩‍💻👨‍💻

Vee Satayamas
Vee Satayamas

Posted on

I try different formats using Rust's Serde

I try different to serialize my data before saving into RocksDB. #rustlang

serde_json

Time

real    4m11.713s
user    13m32.809s
sys     1m33.887s
Enter fullscreen mode Exit fullscreen mode

Space

2.1GB

bincode

Time

real    2m13.772s
user    10m45.541s
sys     1m41.670s
Enter fullscreen mode Exit fullscreen mode

Space

1.1GB

serde-lexpr (S-Expression)

Time

real    10m54.622s
user    22m11.570s
sys     1m10.663s
Enter fullscreen mode Exit fullscreen mode

Space

2.2GB

serde_cbor

Time

real    2m52.010s
user    12m17.019s
sys     1m32.687s
Enter fullscreen mode Exit fullscreen mode

Space

1.7GB

CBOR and bincode are obviously faster than JSON and S-Expression. CBOR is a less efficient than bincode. However, more programming languages support CBOR.

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.