3 ms·
Thanks! Author of lunatic here. Processes don't share any memory, so the message will need to be copied from one process to another. This should be the biggest
by bkolobara 5y ago
Thanks! Author of lunatic here.
Processes don't share any memory, so the message will need to be copied from one process to another. This should be the biggest overhead involved when sending them.
Erlang uses a trick for big binary data structures, they are allocated inside a common memory space and reference counted. That way big messages can be sent just by reference. I was thinking of doing something similar, the wasm spec allows you to import multiple memories and one of the memories could be a commonly shared one. The only issue is that most higher level languages, like Rust, don't have a concept of multiple memories. So it would be really hard to use this trick inside them.
Once we can run lunatic in a distributed way, some messages will need to be sent over the network and we can't cheat there. From this perspective it's even better if we can force architectures where the messages stay small.