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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<pre data-code-wrap="elixir"><code class="lang-elixir">def define_backend_functions(config) do
  # I didn't see backend used in the macros shared
  backend = config.backend

  inner_def = fn locale_name, delimiters -&gt;
    quote do
      delimiters = unquote(delimiters)
      locale_name = unquote(locale_name) # I think one of these 2 unquotes is un-needed, maybe both
      defp quote_marks_for(unquote(locale_name)) do
        unquote(Macro.escape(delimiters))
      end
     end
  end

  asts = Enum.map(Cldr.Locale.Loaders.known_locale_names(config), inner_def)

  {:__block__, [], asts}
end
</code></pre>
<p>I think it would be something like this in the end. I haven’t run the code, but this is the general feeling of “let’s force the macro to expand only once inside the anonymous function”.</p>
<p>I might be wrong, but I think the trick also requires that var!(name, scope) call to ensure the function is defined only once per compilation</p>
<p><a href="https://github.com/phoenixframework/phoenix/blob/675e924f73da1a594e07ba22fcbda6636790ce4a/lib/phoenix/router.ex#L323" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/phoenixframework/phoenix/blob/675e924f73da1a594e07ba22fcbda6636790ce4a/lib/phoenix/router.ex#L323</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374609" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-374609" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374609"
                     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 #31"></div>
  </section>
</div>
    <div class="postbit" id="374611" data-post-id="374611">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you very much <a class="mention" href="/u/polvalente" rel="nofollow">@polvalente</a>, great appreciated. Will give that a whirl.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374611" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-374611" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374611"
                     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 #32"></div>
  </section>
</div>
    <div class="postbit" id="374617" data-post-id="374617">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That’s exactly the technique. Define an anonymous function on <code>use</code> and then use it later on. The <code>var!</code> is not doing anything special though, it is just a mechanism to reuse vars across macros.</p>
<p>And yes, the benefit in this case is that it expand macros once (and the impact will be bigger if you have macros that expands macros that expands to a def/defp).</p>
<p>Although I think in your case you are already reaping those benefits because you only emit <code>defp</code> once (it is wrapped in a <code>for</code>.. but it is expanded once anyway). Unless you are calling  <code>define_backend_functions</code> several times over and over? Then you may see a benefit. In other words, the goal is to avoid the amount of <code>quote</code> you inject.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374617" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-374617" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374617"
                     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 #33"></div>
  </section>
</div>
    <div class="postbit" id="374627" data-post-id="374627">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Wrote 3 simple examples to benchmark compile times. They perform similar without the guards but…it seems the Case-variant is immune for adding guards, while the others start to slow down.</p>
<p>Of course the benchmark is not realistic. Kept it simple, no macro in macro.</p>
<p>test1.ex compiled in 3203.686 ms. → Modules: [Anon]<br>
test2.ex compiled in 1394.32 ms     → Modules: [Case]<br>
test3.ex compiled in 3040.71 ms     → Modules: [Heads]</p>
<p>ps. Yes, naming variables is hard <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<p>Snippets:<br>
<strong>Case</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Case do
  case_ast =
    for i &lt;- 1..10000 do
      {:-&gt;, [], [[{i, i}], i]}
    end

  def foo(x, y) when is_integer(x) and is_integer(y) do
    case {x, y} do
      unquote(case_ast)
    end
  end
end
</code></pre>
<p><strong>Heads</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Heads do
  for i &lt;- 1..10000 do
    def foo(z = unquote(i), a= unquote(i)) when is_integer(z) and is_integer(a), do: unquote(i)
  end
end
</code></pre>
<p><strong>Anon function</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Anon do
  fun = fn x, y -&gt;
      def foo(z= unquote(x), a = unquote(y)) when is_integer(z) and is_integer(a), do: unquote(y)
  end

  for i &lt;- 1..10000 do
    fun.(i, i)
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374627" data-batch-url="/posts/batch_likers">
                        5
                      </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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-374627" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374627"
                     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 #34"></div>
  </section>
</div>
    <div class="postbit" id="374630" data-post-id="374630">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>~What happens when you don’t use guards and just pattern match, guards can certainly slow compilation times in my experiance also they perform worse then pattern matching.~</p>
<p>Nevermind missed: They perform similar without the guards but.</p>
<p>Thinking a bit more about this, I wonder if the compiler eleminates redudent guards, as the case version is not the same as the other, I believe it would preserve the guards, thats why you’re experiencing no difference with guards.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374630" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-374630" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374630"
                     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 #35"></div>
  </section>
</div>
    <div class="postbit" id="374632" data-post-id="374632">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Schultzer" data-post="36" data-topic="57105">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/schultzer/48/4339_2.png" class="avatar"> Schultzer:</div>
<blockquote>
<p>as the case version is not the same as the other</p>
</blockquote>
</aside>
<p>Maybe it’s late and I need some sleep but I see no difference to the others (functionality wise). There is, obviously, less to check though.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374632" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-374632" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374632"
                     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 #36"></div>
  </section>
</div>
    <div class="postbit" id="374633" data-post-id="374633">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>AFAIK then the two other would be compiled down to your case example but with the guards, so they become similar to your test which all contained guards. I hope I explained myself clearly.</p>
<p>Although I believe the compiler should do a better job and not just throw guards around when they clearly is not necessary.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374633" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-374633" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374633"
                     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 #37"></div>
  </section>
</div>
    <div class="postbit" id="374641" data-post-id="374641">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>To be clear, there are two (potentially more) discussions going on. There is one about macros/quote, which can be summarized as the difference between:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmacro fast do
  quote bind_quoted: [] do
    for i &lt;- 1..10000 do
      def foo(z = unquote(i), a = unquote(i)) when is_integer(z) and is_integer(a), do: unquote(y)
    end
  end
end
</code></pre>
<p>and</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmacro slow do
  for i &lt;- 1..10000 do
    quote do
      def foo(z = unquote(i), a = unquote(i)) when is_integer(z) and is_integer(a), do: unquote(y)
    end
  end
end
</code></pre>
<p>(i.e. the difference between expanding once vs expanding 10k times) And in your example, anon and heads are virtually the same because in both scenarios <code>def</code> is expanded only once.</p>
<p>And now there is another discussion, about <code>def</code> vs <code>case</code>. However, I would say your examples are not apples to apples. In one you generate 10k guards (def), in the other one you generate only one. Even if at the end they boil down to the same thing (the compiler is smart enough), in one you are generating waaaay less code than the others.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374641" data-batch-url="/posts/batch_likers">
                        4
                      </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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/39">Post #38</a>
	                </div>
	            </div>
              <div id="likers-container-374641" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374641"
                     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 #38"></div>
  </section>
</div>
    <div class="postbit" id="374642" data-post-id="374642">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This would be a more apples to apples version:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Case do
  case_ast =
    for i &lt;- 1..10000 do
      hd(
        quote do
          {x = unquote(i), y = unquote(i)} when is_integer(x) and is_integer(y) -&gt; y
        end
      )
    end

  def foo(x, y) do
    case {x, y} do
      unquote(case_ast)
    end
  end
end
</code></pre>
<p>Now they all have to go through the same amount of guards and the end result is roughly the same on my machine. I also could not spot any difference between public and private.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374642" data-batch-url="/posts/batch_likers">
                        5
                      </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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/40">Post #39</a>
	                </div>
	            </div>
              <div id="likers-container-374642" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374642"
                     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 #39"></div>
  </section>
</div>
    <div class="postbit" id="374651" data-post-id="374651">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team quote-modified" data-username="josevalim" data-post="39" data-topic="57105">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>However, I would say your examples are not apples to apples. …, in one you are generating waaaay less code than the others.</p>
</blockquote>
</aside>
<p>An apple grown with less water than another appel is still an apple, right? Especially when they taste, look and weight the same.</p>
<p>If you use case statement, you <em>need</em> the guard only once. If you use function heads you <em>need</em> it multiple times.</p>
<p>De-optimizing the case-example does indeed make it ‘the same’ but I fail to see the purpose of watering an option down in benchmarks. It feels like adding weight to a car because “it’s faster due to being lighter”. But maybe I am missing the point entirely.</p>
<blockquote>
<p>Even if at the end they boil down to the same thing (the compiler is smart enough)</p>
</blockquote>
<p>If they boils down to the same thing, I would choose the one fastest to compile.</p>
<p>It might be me, but I fail to see the point why it is unfair (and like to be corrected)</p>
<p>—</p>
<p>Thanks for contributing an improved anon-variant. Gonna try later today.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="374651" 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/compiling-files-with-many-function-heads-is-very-slow-otp-26-issue/57105/41">Post #40</a>
	                </div>
	            </div>
              <div id="likers-container-374651" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="374651"
                     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 #40"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/57105/load_more?page=5">Load more posts (29 remaining)</a>
</div></template></turbo-stream>