Back to Wasmtime

Serializing and Deserializing Modules

docs/examples-serialize.md

44.0.1883 B
Original Source

Serializing and Deserializing Modules

You can also browse this source code online and clone the wasmtime repository to run the example locally:

This example shows how to compile a module once and serialize its compiled representation to disk and later deserialize it to skip compilation on the critical path. See also the pre-compilation example for ahead-of-time compilation.

Host Source

<!-- langtabs-start -->
rust
{{#include ../examples/serialize.rs}}
c
{{#include ../examples/serialize.c}}
cpp
{{#include ../examples/serialize.cc}}
<!-- langtabs-end -->