# How is the new Dialyzer \`--incremental\` mode different?

**URL:** <https://erlangforums.com/t/how-is-the-new-dialyzer-incremental-mode-different/2367>\
**Category:** Questions / Help\
**Tags:** dialyzer\
**Created:** [February 15, 2023, 4:47pm UTC](https://erlangforums.com/t/how-is-the-new-dialyzer-incremental-mode-different/2367 "2023-02-15T16:47:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathanl](https://erlangforums.com/user_avatar/erlangforums.com/nathanl/32/1842_2.png) [@nathanl](https://erlangforums.com/u/nathanl)\
**Post date:** [February 15, 2023, 4:47pm UTC](https://erlangforums.com/t/how-is-the-new-dialyzer-incremental-mode-different/2367/1 "2023-02-15T16:47:39Z")

</div>

From [Release OTP 26.0-rc1 · erlang/otp · GitHub](https://github.com/erlang/otp/releases/tag/OTP-26.0-rc1)

> Dialyzer has a new incremental mode that be invoked by  
> giving the `--incremental` option when running Dialyzer.  
> This new incremental mode is likely to become the  
> default in a future release.

The [docs in the source code](https://github.com/erlang/otp/blob/81e9eb47c0cc9f3bd4bda77237aca2da5ef0ed4d/lib/dialyzer/src/dialyzer_cl_parse.erl#L521-L527) say:

> –incremental  
> The analysis starts from an existing incremental PLT, or builds one from  
> scratch if one doesn’t exist, and runs the minimal amount of additional  
> analysis to report all issues in the given set of apps. Notably, incremental  
> PLT files are not compatible with "classic" PLT files, and vice versa.  
> The initial incremental PLT will be updated unless an alternative output  
> incremental PLT is given.

How is this different from the current strategy? Dialyzer is currently very slow on the first run and much faster after PLT files exist, so in that sense it’s already “incremental” (not starting from the beginning every time).

---

<div class="post-metadata">

**Author:** ![fizfaz](https://erlangforums.com/user_avatar/erlangforums.com/fizfaz/32/1224_2.png) [@fizfaz](https://erlangforums.com/u/fizfaz)\
**Post date:** [February 17, 2023, 11:48am UTC](https://erlangforums.com/t/how-is-the-new-dialyzer-incremental-mode-different/2367/2 "2023-02-17T11:48:20Z")

</div>

[Incremental Dialyzer: How we made Dialyzer 7x Faster | Thomas Davies | Code BEAM America 2023](https://erlangforums.com/t/incremental-dialyzer-how-we-made-dialyzer-7x-faster-thomas-davies-code-beam-america-2023/2086) goes into the details. Since the presentation was made before 26.0-rc1 maybe something changed 🤔 but it explains the concepts very well

---

<div class="post-metadata">

**Author:** ![nathanl](https://erlangforums.com/user_avatar/erlangforums.com/nathanl/32/1842_2.png) [@nathanl](https://erlangforums.com/u/nathanl)\
**Post date:** [February 17, 2023, 4:30pm UTC](https://erlangforums.com/t/how-is-the-new-dialyzer-incremental-mode-different/2367/3 "2023-02-17T16:30:10Z")

</div>

Neat, thanks @fizfaz!

My takeaways:

- Main change: PLTs (with a new iplt format) now include the actual warnings from the previous run
- They did some work to make compilation more deterministic (eg don’t include absolute file paths). (Do we still need to use the `+deterministic` compiler option that Thomas mentioned?)
- PLTs now store info about your actual code, not just your “static context” (dependencies, stdlib, etc)
- Hashes of BEAM files now depend only on the parts that can affect analysis
- Now a small change in application code generally creates a small analysis workload - depends on “the size of the change, plus the transitive closure of code that depends on it” - meaning, if A depends on the changed code, and B depends on A, all of them have to be re-analyzed
