[erlang-questions] Erlang math libraries

Jay Nelson jay@REDACTED
Mon May 21 00:51:00 CEST 2007

Robert Virding wrote:
> I suppose it really depends on what you are going to do with these 
> matrices. If you are going to work with them in Erlang then I don't 
> really see the point of keeping them as binaries.
Binary comprehensions could be very useful if you are doing operations 
on every element of a vector (e.g. scaling).  Also, if you are using a 
very large data set and normalize from 0-255 the binaries give a very 
compact representation, plus the comprehensions should have noticeable 
better memory performance since they can anticipate and preallocate new 
binaries rather than consing off the heap.

All theoretical since I haven't tried, but I would expect a tuple of 
binaries to dramatically outperform a list of lists for certain operations.


More information about the erlang-questions mailing list