[erlang-questions] Erlang Cost Model
Eric des Courtis
Thu Sep 17 01:25:41 CEST 2015
As a first step lets focus on the complexity of the operations (ignoring
any associated constants or specific time measurements). Just so newcomers
to Erlang can validate their assumptions.
I will start:
Adding to the beginning of a list is O(1)
Adding to the end of a list is O(n)
Sending a large binary to another node is O(n)
Sending a large binary to other processes on the same node is O(1)
On Wed, Sep 16, 2015 at 5:11 PM, Tony Rogvall <> wrote:
> On a 64 bit machine that is 60 bits. Just to make things easy.
> On 16 sep 2015, at 23:00, Michael Truog <> wrote:
> Sorry, Erlang uses 27bits for integers before using bignums. Not sure
> where that is documented.
> On 09/16/2015 01:57 PM, Michael Truog wrote:
> I have been using the source code at https://github.com/okeuday/erlbench
> for basic micro-benchmarks, mainly for data structure comparisons. The
> code is a bit basic, but is able to make sure the iterations are large
> enough and are repeated often enough, to avoid some GC variation that can
> affect results. Then it may be possible to make conclusions based on the
> hardware used for testing. The concurrency testing would require tests be
> done in parallel to determine how the timing result is affected, but a
> basic run of low-level operations would provide a starting point.
> As mentioned elsewhere, making sure you are testing bignums (anything over
> 26bits in Erlang, likely different in Python) is important, and other
> details that avoid erroneous conclusions. The influence of concurrency is
> more important in Erlang, due to the support provided by Erlang, but
> latency testing of concurrency is simpler with higher-level connections to
> the Erlang server, rather than low-level testing that is unlikely to
> provide realistic GC usage. The hardware being used for the concurrency
> testing will then provide more variation and it is necessary to make sure
> the hardware is not being throttled due to excessive heat to avoid skewing
> the results.
> On 09/16/2015 08:03 AM, Eric des Courtis wrote:
> What is the cost model of all operations in Erlang 18?
> For example Python has this cost model
> I either want a link to a single source for this information or I would
> like to crowd source the information here now.
> Thanks for your cooperation.
> Eric des Courtis
> erlang-questions mailing ://erlang.org/mailman/listinfo/erlang-questions
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions