Binaries

Bob Cowdery bob@REDACTED
Thu Mar 3 20:56:09 CET 2011


One of the things I need to do is move large binaries of up to 4096
floats around between processes. As there are real-time constraints on
processing this data I just wanted to check a few things.

The docs say that large binaries are zero copy (presumable only in the
same node). How exactly does this work in a lock free environment?

1> T=[1.0].
[1.0]
2> B=term_to_binary(T).
<<131,108,0,0,0,1,99,49,46,48,48,48,48,48,48,48,48,48,48,
  48,48,48,48,48,48,48,48,48,48,...>>
3> size(B).
39

The docs also say that binary data is efficient. Why does 1 float
convert to 39 bytes? This ratio only reduces slightly with larger lists
. If erlang holds floats internally in 64 bit format I don't understand
why it needs 39 bytes.

Bob



More information about the erlang-questions mailing list