[erlang-questions] Is it possible to align binary's byte array to cache line boundary?

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Thu Sep 22 22:46:24 CEST 2011


On Thu, Sep 22, 2011 at 17:49, max tan <maxtqm@REDACTED> wrote:

>
> I just found Haskell has "Data.ByteString.Lazy", according to a paper titled
> "Rewriting Haskell Strings":
>
>   A library for ByteStrings is implemented,   providing a purely functional
> interface, which approaches the speed of low-level mutable arrays in C.
> _______________________________________________

This is true. In many ways, a Lazy ByteString in Haskell corresponds
to a list of binaries in Erlang, which is a subset of the iolist()
type in Erlang. If Haskells Lazy Bytestring implementation approaches
the speed of low-level mutable arrays, so does binaries in Erlang.

My experience is they perform at about the same speed. I don't know
what happened in my brain when I called Haskell a dynamic language
though. It is statically typed, and very much so.


-- 
J.



More information about the erlang-questions mailing list