[erlang-questions] term_to_binary and record improvements

Claes Wikstrom klacke@REDACTED
Sun Sep 28 00:25:18 CEST 2008


Bjorn Gustavsson wrote:

> It is easy to preserve sharing if you are allowed to destroy the source 
> term (as in the garbage collector).
> 
> Preserving sharing when copying a term (i.e. not destroying the source 
> term) is harder and
> WILL be slower compared to not preserve sharing.

Correctly, this is code that I remember Tony Rogavall and I
stared at for years. I know of no good way to implement
term_to_bianary/1 or the copying of spawn() args
better than is done today.
It would be possible to implement sharing, but it would cost
dearly and the net effect would be bad in most cases.

/klacke





More information about the erlang-questions mailing list