Suppose I create a new local process in an erlang application and I want to send him a big message.
-module(chain_hello). start(N, Some_big_data)-> Pid1 = spawn(chain_hello, some_fun, [N]), Pid1 ! Some_big_data, io:format("done \n").
despite the fact that Some_big_data is a link to really big data (for example, the contents of a file) - is it copied when sending? Are there big penalties for performance?
Normally I would use some thread safe shared object (and / or mutex). Is there a solution in Erlang to avoid copying the contents of the message?
ADDED:
An interesting case is that Some_big_data is structured content - for specific: map, on which I can perform some operations.
ADDED2
Well, I see that for Erlang there is no such solution (cutting some structured data, such as a map in the workflow) - due to Erlang design. But I think this is justified by solid performance and is easily consistent with management.
source share