alexdovzhanyn / AlchemyVM

WebAssembly Virtual Machine Built In Elixir
MIT License
188 stars 5 forks source link

Parallel Decoding #13

Closed alexdovzhanyn closed 5 years ago

alexdovzhanyn commented 5 years ago

Wasm binary format is structured in such a way that it should be easy to decode its sections independent of each other. We can make use of Elixir's cheap concurrency to decode each section of a module in parallel.

We do an 'initial' decoding passthrough where each of the modules sections are split into its respective parts as binaries. After this, we decode each section one by one. It should be a rather simple optimization to spin up a process for each of the sections which decodes them, and then merges them back into the module.