[erlang-questions] Updating Myths of Erlang Performance

Valentin Micic valentin@REDACTED
Sat Jun 4 13:42:18 CEST 2016

On 04 Jun 2016, at 9:41 AM, Björn Gustavsson wrote:

> On Sat, Jun 4, 2016 at 9:07 AM, Valentin Micic <valentin@REDACTED> wrote:
>> On 04 Jun 2016, at 8:13 AM, Björn Gustavsson wrote:
>>> "I thought binaries were always faster than lists, so why is binary
>>> matching slower than list matching?"
>> Stated this way, the myth may be confusing to some people (well, it is for me).
>> So, what is the myth? Is it that binaries are faster than lists,  or that binary matching is slower then list matching?
> Yes, the myth needs some polishing.
> Here are some more details of what I had in mind.
> It is often recommended to use binaries (for example in this mailing)
> instead of lists.

It is, indeed, my experience that operations on binaries are considerably slower than functional equivalent operation on lists.

I think that things get even worse when one utilizes bit-syntax instead of using bitwise operations on an individual element of the list.

However, if the speed of execution is not essential for a success, the binary syntax makes the code far easier to follow compared to the functional equivalent implemented via lists.

Or is this another myth?


More information about the erlang-questions mailing list