[erlang-bugs] Slow process dictionary

Fredrik Svahn fredrik.svahn@REDACTED
Sun Dec 16 23:41:25 CET 2007


There seems to be something strange going on in the process dictionary in
R12B-0.

Operations which would take a tenth of a second in R11B-5 can now take more
than 30 seconds. Please see test program below.

Archictecture and OS: Linux laptop 2.6.24-rc1 #4 SMP Wed Oct 31 20:35:25 CET
2007 x86_64 AMD Turion(tm) 64 X2 Mobile Technology TL-60 AuthenticAMD
GNU/Linux
Erlang environment: Erlang (BEAM) emulator version 5.6 [source] [64-bit]
[smp:2] [async-threads:0] [hipe] [kernel-poll:false]

Thanks to Isaac Gouy for pointing out the differences between R11B-5 and
R12B-0. The same problem can be found e.g. on the nsieve benchmark on the
Computer Language Shootout on Intel P4/Gentoo (
http://shootout.alioth.debian.org/gp4/benchmark.php?test=nsieve&lang=hipe&id=0
).

BR /Fredrik Svahn

---
$ otp_src_R11B-5/bin/erl -noshell -noinput -run test main 100000
{31993,ok}
{98370,ok}
$ otp_src_R11B-5/bin/erl -noshell -noinput -run test main 110000
{35415,ok}
{104100,ok}

---
$ erlc test.erl
$ erl -noshell -noinput -run test main 100000
{100002,ok}
{3575867,ok}
$ erl -noshell -noinput -run test main 110000
{107884,ok}
{33342695,ok}


-module(test).
-export([main/1, dict/1, reverse_dict/2]).

main([Arg]) ->
    N=list_to_integer(Arg),
    io:format("~p~n",[timer:tc(?MODULE, reverse_dict, [N, 0])]),
    erase(),
    io:format("~p~n",[timer:tc(?MODULE, dict, [N])]),
    erlang:halt(0).

reverse_dict(M, M) -> ok;
reverse_dict(M, I) -> put(M, 0), reverse_dict(M, I+1).

dict(1) -> ok;
dict(M) -> put(M, 0), dict(M-1).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20071216/9d41be72/attachment.htm>


More information about the erlang-bugs mailing list