[erlang-questions] Erlang Cost Model
Richard A. O'Keefe
Fri Sep 18 02:54:57 CEST 2015
On 17/09/2015, at 3:03 am, Eric des Courtis <> wrote:
> What is the cost model of all operations in Erlang 18?
> For example Python has this cost model http://scripts.mit.edu/~6.006/fall07/wiki/index.php?title=Python_Cost_Model
So let's look at that page, and you'll spot something interesting
in the URL.
(1) That page was last revised in January 2008; the results
are from 2007. Looking at neighbouring pages like
I get "Database error", which suggests that the site has
not been maintained for too long.
Poke around a bit further, and you'll find
(2) It used Windows XP (version of 2001) on "an IBM Thinkpad
T43p with a 1.86GHz Pentium M processor and 1.5GB RAM."
(3) The version of Python used for the tests is not stated, but
the Python version current at the time was 2.5.1.
(4) The author thought "extract a byte from a string"
was an interesting operation.
Let's compare that with today.
(1) It's September 2015, nearly 8 years since the measurements
(2) I'm using Mac OS X 10.9.5 on an iMac14.2 with a 3.2 GHz Intel
Core i5 with 4 cores (and using those 4 cores is an important
part of *system*-level efficiency) and 16 GiB of 1.6 GHz
DDR3 memory. The architecture of a Core i5 is significantly
different from a Pentium M, and it's not just the 64-bit ISA.
(3) Python 2.7.8 was released in mid-2014 but the current version
is Python 3.5.0. The benchmarks had much to say about
integers and strings, and these are two areas which have seen
MAJOR changes in the change to Python 3.
(4) Unicode is everywhere these days; characters are no longer bytes.
At least one of the benchmarks is now of questionable relevance.
In short, before I used that "Python cost model" page for
*anything*, I'd have to first port timing.py to Python 3 (which
may or may not be trivial; no idea without trying it), and then
rerun it on my machine. I'd still be wondering what difference,
if any, building with recent clang, recent gcc, or recent icc
And it *still* wouldn't tell me anything about the cost of using
NumPy or SciPy or PyQt or TKinter or ....
More information about the erlang-questions