Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Conversation

@dragonnn
Copy link
Contributor

This adds serde support to TinyWasmModule as discussed in #31. It doesn't pull any specific de/serialization format yet. No TinyWasmModule changes where need for enabling that.
I will add later some benchmarks serde+postcard vs rkyv.

@dragonnn
Copy link
Contributor Author

Add a few benchmarks, on my machine I got those results:

argon2id_to_twasm                       time:   [119.92 µs 120.90 µs 121.80 µs]
argon2id_to_postcard_wasm       time:   [102.52 µs 102.69 µs 102.86 µs]
argon2id_from_twasm                  time:   [85.649 µs 86.601 µs 87.463 µs]
argon2id_from_postcard_wasm  time:   [81.646 µs 81.889 µs 82.421 µs]

fibonacci_to_twasm                       time:   [1.0138 µs 1.0142 µs 1.0145 µs]
fibonacci_to_postcard_wasm       time:   [975.92 ns 979.69 ns 983.51 ns]
fibonacci_from_twasm                  time:   [573.34 ns 573.62 ns 573.93 ns]
fibonacci_from_postcard_wasm  time:   [794.84 ns 796.40 ns 798.04 ns]

tinywasm_to_twasm                      time:   [3.5952 ms 3.6018 ms 3.6086 ms]
tinywasm_to_postcard_wasm      time:   [2.5932 ms 2.6109 ms 2.6333 ms]
tinywasm_from_twasm                 time:   [2.4116 ms 2.4305 ms 2.4504 ms]
tinywasm_from_postcard_wasm time:   [1.9223 ms 1.9239 ms 1.9257 ms]

Looks like serializing is slight faster with postcard then rkyv, deserializing looks like it might be a lite bit slower for small programs but faster for big ones? In both cases I would say the performance of it is acceptable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant