Excessive recompilations when nothing substantially changed

Not quite, you have that reversed. Now C has a compile-dependency on both A and B. The compile-time dep on B is direct, but the compile-time dep on A is transitive (because A depends on B at compile-time). This means that if the a.ex file or b.ex file is changed then c.ex needs to be recompiled (it generally doesn’t make too much difference but compilation dependencies are tracked on a per-file basis even though the dependencies are introduced on a per-module basis).

I’m pretty sure this is the blog post you are referring to:
https://medium.com/multiverse-tech/how-to-speed-up-your-elixir-compile-times-part-2-test-your-understanding-f6ff3de5eb5d

I highly highly recommend it to anyone struggling with recompilation in Elixir. It’s well worth the time to read through and test out the exercises.

Also a shameless plug for anyone that wants to narrow down where they might want to focus their recompilation efforts I wrote a tool called DepViz:

2 Likes