Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang: dialyzer is dead slow for a big project

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?

like image 452
evnu Avatar asked Oct 06 '22 22:10

evnu


1 Answers

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.

like image 192
aronisstav Avatar answered Oct 10 '22 03:10

aronisstav