Tracking down superlinear reductions
Sat Jun 17 01:14:02 CEST 2006
Bengt Kleberg wrote:
> On 2006-06-16 12:13, Andrew Lentvorski wrote:
>> What I'd like to do is the Erlang equivalent of getting the number of
>> times a function is called. This would avoid the problem of Erlang
>> trying to print out the arguments and flooding the I/O system.
> have a look at: cprof, eprof, fprof and friends, in the tools section of
> the docuemntation.
cprof did it.
Ouch! And that's only for 1000 packets. That's the only function in my
entire program that isn't within a small multiplier of 1000. I'm not
calling orddict:store() anywhere near that many times.
It looks like orddict:store() is an O(n) function as it seems to be
doing a linear scan. That explains why its about 1000*1000/2. A linear
scan should be O(n)/2.
I'll go look at the gb_trees module.
Thanks for the help,
More information about the erlang-questions