erlang statistics

Wes James comptekki@REDACTED
Tue Mar 8 18:14:21 CET 2011


I'm going through some code in the book "Concurrent Programing in
ERLANG".  I ran the statistics on the sort and qsort thus:

$ erl
Erlang R14B01 (erts-5.8.2) [source] [smp:2:2] [rq:2] [async-threads:0]
[hipe] [kernel-poll:false]

Eshell V5.8.2  (abort with ^G)
1> statistics(exact_reductions),
1> sort:sort([2,1,4,23,6,7,8,43,9,4,7]),
1> {_, Reductions1} = statistics(exact_reductions),
1> qsort:qsort([2,1,4,23,6,7,8,43,9,4,7]),
1> {_, Reductions2} = statistics(exact_reductions),
1> io:format("~p~n",[Reductions1]),
1> io:format("~p~n",[Reductions2]).
3111
4922
ok

I tried statistics(reductions) and statistics(exact_reductions) (per
erlang.org docs).

Why are the reductions different than the book and the qsort is slower
than the sort, it appears??

thx,

-wes


More information about the erlang-questions mailing list