Rich_Morin

Rich_Morin

I’ve been adding and refining specs on my (12 KLOC Elixir) project. This is an iterative process, so I run Dialyzer a lot. Even after the PLT has been built, each run takes several seconds. I’d like to know if there is anything I can do to speed this up.

I’m currently running Dialyzer on a MacBook Air (1.8 GHz Intel Core i7, 4 GB RAM, dual core, 1 TB SSD, …) Would it run faster on a machine with more cores or RAM? Any other suggestions?

-r

Showing Posts 1 to 10

rodrigues

rodrigues

Hi @Rich_Morin, do you specify a plt_add_deps option?

By defining it as :apps_direct, you can restrict manually the app tree, and the whole process could be a bit faster (not only making the plt, but running dialyzer after it too).

Rich_Morin

Rich_Morin OP

Good suggestion; I’ll try that out. The documentation lists several options, but I’m not sure about their implications:

  • :project - Direct Mix and OTP dependencies
  • :apps_direct - Only Direct OTP application dependencies - not the entire tree
  • :transitive - Include Mix and OTP application dependencies recursively
  • :app_tree - Transitive OTP application dependencies e.g. mix app.tree (default)

Comments and/or explanations would be appreciated!

Rich_Morin

Rich_Morin OP

I tried adding plt_add_deps: :apps_direct. This caused the PLT to be rebuilt, taking about 20 minutes. After that, I found that Dialyzer took about 10 seconds per run (down from 12). However, it now issues quite a few complaints about not being able to find information on Plug....

I assume that I can get rid of these by adding more options, but at 20 minutes per experiment, this isn’t my idea of fun. Can anyone suggest a set of options that Just Works for a typical Phoenix project?

dimitarvp

dimitarvp

I found the default to never error (in terms of not being able to find modules).

This likely isn’t the answer you are after but MacBook Airs are quite weak and sadly 10-12 secs per Dialyzer run is pretty normal. My MBP 2015 checks ~400 files in 6-7 seconds.

Rich_Morin

Rich_Morin OP

Thanks for the feedback and data point. I also have a 2010 Mac Pro (12 cores, 3.4 GHz, oodles of RAM), so I plan to try running on that. I’d love to know whether Dialyzer takes advantage of multiple cores; can someone point me to any information on that?

dimitarvp

dimitarvp

AFAIK anything that uses OTP makes use of multicore implicitly. I’ll be very interested in your Mac Pro 2010 datapoint btw; I am still torn between buying a refurbished (but maxed) Mac Pro 5,1 2012 or go all in with an iMac Pro 2017. I am very curious how well does the parallel compilation do with those old-ish Xeon CPUs.

Rich_Morin

Rich_Morin OP

AFAIK anything that uses OTP makes use of multicore implicitly.

I’m sure Dialyzer gets some implicit multicore benefits in terms of IO and such, but unless its analysis is split up into multiple actors, only one core can be working on it at a time.

FWIW, I’m quite happy with the Mac Pro 5,1. I particularly like the ability to add disks, graphics cards, memory, etc. I’ll post my timing results RSN…

NobbZ

NobbZ

It tries to as best as it can, but some tasks are basically not parallelizable.

rodrigues

rodrigues

With :apps_direct mode, you’d need to add some apps manually through the option plt_add_apps, in my case for a phoenix app I do:

  plt_add_deps: :apps_direct,
  plt_add_apps: ~w(
    ecto
    ex_unit
    mix
    phoenix_pubsub
    plug
    telemetry
  )a,
  # ...

I got there by having failures such as the one you’ve had with Plug. It took me some time, but, by doing that, I remember having reduced quite a bit the plt cache building time, and also the running time, compared to before. Don’t have the measures anymore though.

EDIT:

Just ran it in a project both options to compare, both phases are indeed faster, but it’s the PLT caching that gets more impact comparing to default:

plt_add_apps dialyzer clean run dialyzer with plt cached
apps_direct 1m 9s 277ms 3.66s
default 3m 56s 530ms 4.51s
Rich_Morin

Rich_Morin OP

I finally got around to running Dialyzer on my 2010 Mac Pro. It takes about six seconds, as compared to the 10-12 it takes on my MB Air.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews