You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wasmer compilation takes time. We can improve things by saving the compiled modules in cache.
Let's make a finite-size cache of compiled Wasmer modules indexed by the bytecode hash:
as Module objects when in RAM => they are ready to be instantiated
in the future, if the RAM storage is not enough, also store as Serialized Modules on disk => they can then be deserialized, added to RAM cache, instantiated and executed
When a block containing uncached bytecodes needs to be exectued, threads should be launched to compile them all in parallel, put them in cache, and instanciate + execute them as they become ready.
When new bytecode is inserted/changed in the ledger, a separate thread should be launched to cache it as well, in order to be ready for its future execution.
Isn't hashing the bytecode too long ? => 127µs for 500kilobytes, 25µs for 100kilobytes
Improvement idea: in the bytecode field of the ledger, store the following:
a varint u32 VM version/variant number
the hash of the version + bytecode (to be updated every time the bytecode changes)
the actual bytecode
That way, the module hash is readily available.
The text was updated successfully, but these errors were encountered:
Wasmer compilation takes time. We can improve things by saving the compiled modules in cache.
Let's make a finite-size cache of compiled Wasmer modules indexed by the bytecode hash:
When a block containing uncached bytecodes needs to be exectued, threads should be launched to compile them all in parallel, put them in cache, and instanciate + execute them as they become ready.
When new bytecode is inserted/changed in the ledger, a separate thread should be launched to cache it as well, in order to be ready for its future execution.
Isn't hashing the bytecode too long ? => 127µs for 500kilobytes, 25µs for 100kilobytes
Improvement idea: in the
bytecode
field of the ledger, store the following:That way, the module hash is readily available.
The text was updated successfully, but these errors were encountered: