Tracking down superlinear reductions

Ulf Wiger (AL/EAB) <>
Fri Jun 16 12:52:49 CEST 2006


One could imagine using QuickCheck and specifying as a property that the
number of reductions (returned from statistics(reductions) should be
roughly proportional to the size of the input.

QuickCheck will then generate random input, according to a
specification, and report if it finds a case where the number of
reductions is out of bounds for the given input.

I haven't actually tried it, though.

BR,
Ulf W 

> -----Original Message-----
> From:  
> [mailto:] On Behalf Of 
> Andrew Lentvorski
> Sent: den 16 juni 2006 12:13
> To: erlang-questions
> Subject: Tracking down superlinear reductions
> 
> pman seems to be reporting that I have a gen_server that 
> appears to be doing a superlinear (probably closer to 
> quadratic, but I haven't done the full analysis, yet) number 
> of reductions (200,000,000+) for what should only be a linear 
> amount of work (14,000 packets).
> 
> Dialyzer doesn't report anything obviously stupid, so I'm 
> going to need to dig into this further.
> 
> Which tool should I use to analyze this?  pman seems to be 
> choking on the trace.  I see a couple of different programs 
> listed in the "Tool Applications" section of the manual, but 
> nothing jumps out at me as being the obvious choice.
> 
> 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.
> 
> What's the best way to do this?
> 
> Thanks,
> -a
> 



More information about the erlang-questions mailing list