[erlang-questions] dialyzer orelse filter slowness
Kostis Sagonas
kostis@REDACTED
Thu Mar 26 09:30:26 CET 2009
Nick Conrad wrote:
> Hello,
>
> I've got a module that dialyzer takes more than 15 minutes to analyze,
> and I've narrowed down the cause to a fairly long orelse expression
> that is being used as a filter in a list comprehension. If I replace
> the orelse expression with a function call and make each individual
> test it's own function, dialyzer is much happier and completes within
> seconds. Does anyone have an explanation for why dialyzer might take
> so long on the orelse's when used as a filter?
>
> Here's a bit of code that demonstrates the issue, which I've seen
> using both R11B and R12B.
> [CODE SNIPPED]
>
> % dialyzer --no_check_plt --src -c .
> Proceeding with analysis... done in 0m0.23s
> done (passed successfully)
>
> % dialyzer -DUSE_ORELSE=1 --no_check_plt --src -c .
> Proceeding with analysis... done in 0m32.24s
> done (passed successfully)
In all probability, this has to do with the convoluted translation of
orelse in R11B and R12B. In R13* orelse's (and andalso's) translation
has changed and is much more sane. I suggest that you switch to R13A
(there are many other reasons to).
% dialyzer -v
Dialyzer version v1.9.0
% dialyzer -n -c or_else.erl
Proceeding with analysis... done in 0m0.68s
done (passed successfully)
% dialyzer -DUSE_ORELSE=1 -n -c or_else.erl
Proceeding with analysis... done in 0m0.91s
done (passed successfully)
Kostis
More information about the erlang-questions
mailing list