[erlang-questions] when is data copied?
Fri Mar 17 11:55:14 CET 2017
Pattern matching is broken into a decision tree during compile time, and
this tree is evaluated while doing jumps to corresponding clauses. It is
normal Erlang code under the hood, which manipulates Erlang values normally
withing current process, so they are handled efficiently.
There's nothing you can optimize in regards to the data copying.
To see how bad is the code you can do benchmarks yourself using timer:tc,
thats the simplest. You can compile to intermediate code such as Kernel
erlang (shell command c(mymodule, [to_kernel]). ) and read the produced
code, or disassemble the module (shell command erts_debug:df(module). )
2017-03-17 11:45 GMT+01:00 Xavier Noria <fxn@REDACTED>:
> Awesome, thanks!
> What about pattern matching?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions