[erlang-questions] Strange optimization result

Bjorn Gustavsson bjorn@REDACTED
Sun Oct 21 11:41:12 CEST 2007


"Anders Nygren" <anders.nygren@REDACTED> writes:
> 
> My only idea is that this is caused by some pathological CPU cache
> behaviour. Does anyone have a better explanation?

Could be. I have another GUESS: using a tuple instead of dict will
result in a smaller heap size for the spawned process, which will lead
to more frequent garbage collections. You could use the spawn_opt()
BIF with the min_heap_size option.

To get a similar heap size as when using a dict, use

        erts_debug:size(wfbm3:init()).

which is 1120.

/Bjorn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list