<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="260996" data-post-id="260996">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Also, though, just avoid calling modules from other module bodies.  For example, there was a <em>lot</em> of this in the codebase I worked in:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Foo do
  @foos = %{
    a: A,
    b: B,
    c: C
  }
end
</code></pre>
<p>Don’t do that!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="260996" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-260996" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="260996"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="261043" data-post-id="261043">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="riebeekn" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/riebeekn/120/13981_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  riebeekn
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sorry to hear about the health issues, hope they get resolved!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261043" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-261043" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261043"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="261044" data-post-id="261044">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="riebeekn" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/riebeekn/120/13981_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  riebeekn
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Nice!  Thanks for the suggestions, definitely gives me some things to look into.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261044" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-261044" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261044"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="261050" data-post-id="261050">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="axelson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/120/26351_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  axelson
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Scenic Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sodapopcan" data-post="21" data-topic="37600">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>…now both <code>B</code> <em>and</em> <code>A</code> have a compile-time dep on <code>C</code> (with <code>A</code> also depending on <code>B</code>)</p>
</blockquote>
</aside>
<p>Not quite, you have that reversed. Now <code>C</code> has a compile-dependency on <em>both</em> <code>A</code> and <code>B</code>. The compile-time dep on <code>B</code> is direct, but the compile-time dep on <code>A</code> is transitive (because <code>A</code> depends on <code>B</code> at compile-time). This means that if the <code>a.ex</code> file or <code>b.ex</code> file is changed then <code>c.ex</code> 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).</p>
<aside class="quote no-group" data-username="sodapopcan" data-post="21" data-topic="37600">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>This info is scattered around these forums and I know someone wrote a blog post recently but I can’t find it.</p>
</blockquote>
</aside>
<p>I’m pretty sure this is the blog post you are referring to:<br>
<a href="https://medium.com/multiverse-tech/how-to-speed-up-your-elixir-compile-times-part-2-test-your-understanding-f6ff3de5eb5d" class="onebox" target="_blank" rel="noopener nofollow">https://medium.com/multiverse-tech/how-to-speed-up-your-elixir-compile-times-part-2-test-your-understanding-f6ff3de5eb5d</a></p>
<p>I <em>highly highly</em> recommend it to anyone struggling with recompilation in Elixir. It’s well worth the time to read through and test out the exercises.</p>
<p>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:</p>
<aside class="quote quote-modified" data-post="1" data-topic="35408">
  <div class="title">
    <div class="quote-controls"></div>
    <img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/48/26351_2.png" class="avatar">
    <div class="quote-title__text-content">
      <a href="https://forum.elixirforum.com/t/depviz-a-visual-tool-to-understand-inter-file-dependencies/35408" rel="nofollow">DepViz - A visual tool to understand inter-file dependencies</a> <a class="badge-category__wrapper " href="/c/chat-discussions/chat-discussions/167" rel="nofollow"><span data-category-id="167" style="--category-badge-color: #cca771; --category-badge-text-color: #FFFFFF; --parent-category-badge-color: #cca771;" data-parent-category-id="165" data-drop-close="true" class="badge-category --style-square --has-parent"><span class="badge-category__name">Discussions</span></span></a>
    </div>
  </div>
  <blockquote>
    Hi everyone <img width="20" height="20" src="https://forum.elixirforum.com/images/emoji/apple/wave.png?v=15" title="wave" alt="wave" class="emoji"> 
I’ve always wanted a tool to better visually understand inter-file dependencies in Elixir projects to help me reduce compilation dependencies (and hence, reduce recompilation times), but none existed so I wrote my own! As part of my Code BEAM BR talk I’d like to release the tool. 
Try it online at: <a href="https://depviz.jasonaxelson.com/" rel="nofollow">https://depviz.jasonaxelson.com/</a> 
Or view the code: 

This is what it looks like when you view a project: 
 <a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/3/4/34f4d157e19c6b36127fa6cc41e98ad1c9b86ffa.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/34f4d157e19c6b36127fa6cc41e98ad1c9b86ffa" title="screenshot_credo" rel="nofollow">[screenshot_credo]</a> 
It can highlight dependencies of a given file: 
 <a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/c/f/cf2d099fca8391e044fefe9f7b98b5a0d335b81e.png" data-download-href="https://forum.elixirforum.com/uploads/default/cf2d099fca8391e044fefe9f7b98b5a0d335b81e" title="screenshot_highlight_credo" rel="nofollow">[sc…</a>
  </blockquote>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261050" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-261050" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261050"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="261052" data-post-id="261052">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>One thing that got used a bunch at my old company was repurposing behaviour modules for other things.  For example, a lot of them would expose a function to enumerate all the modules that implemented the behaviour (which is not a good idea when you think about it).  Anyway, that was one more thought I had that might possibly be in your codebase.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261052" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-261052" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261052"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="261054" data-post-id="261054">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="axelson" data-post="25" data-topic="37600">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/48/26351_2.png" class="avatar"> axelson:</div>
<blockquote>
<aside class="quote no-group" data-username="sodapopcan" data-post="21" data-topic="37600">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>…now both <code>B</code> <em>and</em> <code>A</code> have a compile-time dep on <code>C</code> (with <code>A</code> also depending on <code>B</code>)</p>
</blockquote>
</aside>
</blockquote>
</aside>
<p>Oops, yes indeed!   And yes, that is the post, thanks!  I’ve saved it this time 'round.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="261054" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-261054" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="261054"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="288168" data-post-id="288168">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="riebeekn" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/riebeekn/120/13981_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  riebeekn
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Was revisiting this a bit today and realized I forgot to mention that in addition to the sugggestions above we found adding <a href="https://github.com/sasa1977/boundary" class="inline-onebox" rel="noopener nofollow ugc">GitHub - sasa1977/boundary: Manage and restrain cross-module dependencies in Elixir projects · GitHub</a> to be super helpful.  It helped surface some poorly defined boundaries we had going on.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="288168" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/excessive-recompilations-when-nothing-substantially-changed/37600/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-288168" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="288168"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>