Question

The Scalaris key-value store is a big Erlang project with ~100 modules. I am implementing a new module within this project and am struck by how long it takes for dialyzer to do one complete check of the project. A run of make dialyzer takes about 200s on my machine here, which is unbearable for frequent testing while implementing changes.

make dialyzer runs the following command to start dialyzer:

/usr/lib/erlang/bin/dialyzer -Dtid_not_builtin -Dwith_export_type_support  \
        -DNO_FILE_SENDFILE -Dhave_cthooks_support -Dhave_callback_support  \
        -Werror_handling -Wrace_conditions -Wunmatched_returns -I include/ \
        -I contrib/yaws/include/ -I contrib/log4erl/include/ \
        --src -c src src/*/ test/unittest_helper.erl test/tester*.erl \
                          test/mockup*.erl test/erl_id_trans.erl \
                          test/measure_util.erl test/scalaris_cth.erl \
        --no_native

I guess that I should be able to only include the files needed for my module in the parameter list for --src, but that list is probably quite big and it comes down to including 90 files of the given 100. Is there a better way to speed up dialyzer with the assumption that only one module is going to change between the subsequent runs?

Was it helpful?

Solution

If the rest of the modules do not have calls within the changing module, then you can add them to your PLT and they will not be checked every time. If they do have calls however, there is no way to make sure that the results from these calls will be the same if you change the code in the changing module.

dialyzer --add_to_plt <unchanged modules>

If you have a multicore machine, you might also want to use Erlang R15B02 (not released at the time I'm writing this, but available for building on the 'maint' branch of https://github.com/erlang/otp), which has a parallel version of Dialyzer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top