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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adw632" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adw632
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hst337" data-post="5" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/48.png" class="avatar"> hst337:</div>
<blockquote>
<p>And I think that it is totally fine to advertise not-yet-ready solution, because it will provide some battle-testing by early adopters (one of whom is a member of already mentioned Membrane project), some useful feedback, and might even help me get some money for my work</p>
</blockquote>
</aside>
<p>It’s obvious you’re quite a bright person and have invested significantly in developing tria.</p>
<p>I think diversity with compiler implementations is a healthy thing, there are always lessons to be learned and different perspectives that can yield improvement.</p>
<p>But the statement “just use tria” was a bit naive in my view.</p>
<p>Just look at the the long road to implementing <a href="https://www.erlang.org/blog/the-road-to-the-jit/" rel="nofollow">erlangs JIT</a> to where we finally have something viable.</p>
<p>Maybe tria may discover some fertile ground and lead to improved performance, we can only hope.</p>
<p>However “just” jumping to another compiler is not going to be viable for most, until tria reaches battle tested status.</p>
<p>Until then, may be you can identify some selective use cases where tria may prove useful, eg as a set of processing nodes in a cluster where the benefit of tria performance can be realised for some safe subset of the code base.</p>
<p>e.g. does tria work with Nx? would tria be compelling for a numerical compute node? If not, then what <strong>is</strong> the compelling use case for tria?</p>
<p>Getting actual adoption for some concrete use cases  would provide important lessons and feedback until fully semantic Elixir/Erlang compatibility is achieved in tria.</p>
<p>I think clearly communicating and being honest about where the rough edges are is essential.</p>
<p>My sense is you have rubbed the community the wrong way, claiming tria is a drop in replacement for elixir which solves everything when it actually doesn’t RIGHT NOW.</p>
<p>Also think about how could one integrate with say one or more tria nodes in their cluster?  This might help with both getting real-world use and ultimately adoption until fully battle tested elixir compatibility is realised.</p>
<p>The benefit of even considering tria needs to warrant the additional risk and complexity and that’s always the challenge.</p>
<p>I don’t think there is a single person in the Elixir community who is convinced, other than you, the author.</p>
<p>You need to change that by being real.</p>
<p>I currently don’t see a compelling reason for tria other than my own intellectual curiosity, but ultimately already have it relegated as an “incomplete elixir implementation by a wannabe who agitates the community.”</p>
<p>I’m saying what most are thinking, but beyond that I actually do think you’re very smart and capable so hopefully you take my suggestion and feedback the right way so that your contributions are <strong>constructive</strong> and lead to improving the state of elixir in ways we can’t predict.</p>
<p>If you do expect the community to take you seriously and to have any chance of competing against the status quo of Elixir on the BEAM you need to be cooperative rather than antogonistic and identify the compelling use case that tria fills.</p>
<p>Could any of it be incorporated into the BEAM or elixir proper?</p>
<p>Can others even work with you?</p>
<p>Elixir thrives because Jose both leads and works with others towards outcomes that benefit the community. I am sure if collaboration was possible it would have already happened.</p>
<p>However if tria js just an academic excercise in compiler writing to be able to say “FIGJAM” then please ignore my post while the rest of the elixir community continue to ignore you and tria.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306181" 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/access-optimizations-from-hisssssts-compiler/59347/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-306181" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306181"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="306182" data-post-id="306182">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hst337" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hst337
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>e.g. does tria work with Nx? would tria be compelling for a numerical compute node?</p>
</blockquote>
</aside>
<p>Yes, it does</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>Getting actual adoption for some concrete use cases would provide important lessons and feedback until fully semantic Elixir/Erlang compatibility is achieved in tria.</p>
</blockquote>
</aside>
<p>That’s true, and that’s why I am talking about the project whenever it is possible: to find someone who wants to try it out locally, not in production, but just in personal setup.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>My sense is you have rubbed the community the wrong way, claiming tria is a drop in replacement for elixir which solves everything when it actually doesn’t RIGHT NOW.</p>
</blockquote>
</aside>
<p>Where did I say that Tria is suitable for usage right now? I didn’t say that. But Tria will be a drop-in replacement. It is almost one already. There is no unsolved problem, except stracktrace formatting, but there are a lot of bugs, which can caught only during the testing. When I wrote “Just use Tria”, it was merely advertising, and I’ve explained what I meant in the next post.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>Also think about how could one integrate with say one or more tria nodes in their cluster?</p>
</blockquote>
</aside>
<p>Compiler is completely irrelevant to these kinds of problems. Using Tria or Erlang, or Elixir or Gleam won’t change anything in the BEAM cluster.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>The benefit of even considering tria needs to warrant the additional risk and complexity and that’s always the challenge.</p>
</blockquote>
</aside>
<p>That’s true, and that’s what’s written on the top of the README of the project.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>I currently don’t see a compelling reason for tria other than my own intellectual curiosity</p>
</blockquote>
</aside>
<p>Performance. The main goal of Tria is performance. Write some Enum pipes, use some dots, run some benchmarks and see the impact yourself.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>If you do expect the community to take you seriously and to have any chance of competing against the status quo of Elixir on the BEAM you need to be cooperative rather than antogonistic and identify the compelling use case that tria fills</p>
</blockquote>
</aside>
<p>Where did I say anything antagonistic? I am always cooperative, and I am open for constructive feedback about compiler’s features and I am open to contributions. To be honest, I value your attention and feedback, but I don’t see anything constructive in it. Perhaps you could give compiler a try, perhaps you could read it’s code, analyze it’s approaches and then improve it with some useful criticism about technical implementation.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>Could any of it be incorporated into the BEAM or elixir proper?</p>
</blockquote>
</aside>
<p>Yes, absolutely. I’ve even found some bugs in Elixir during development of the compiler</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>Can others even work with you?</p>
</blockquote>
</aside>
<p>Yes, I’ve even invited several people personally. I sent mails to people who were doing projects in the same area, we’ve shared ideas, tried to collaborate on some features. You can find a topic with collaboration invite somewhere on this forum.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>However if tria js just an academic excercise in compiler writing to be able to say “FIGJAM” then please ignore my post while the rest of the elixir community continue to ignore you and tria.</p>
</blockquote>
</aside>
<p>I am not from academia, nor this project is academic. Tria is aiming to be production-ready with an engineering set of goals. Tria is about bringing existing optimizing compilers’ features to the language, it is not a project about researching new ones.</p>
<aside class="quote no-group" data-username="adw632" data-post="12" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>I am sure if collaboration was possible it would have already happened</p>
</blockquote>
</aside>
<p>Why is that? And why are sure that collaboration is impossible?</p>
<hr>
<p>My overall expression about your post is that you don’t know anything about the project and that you made several wrong assumptions while reading my posts. If you’re really interested in writing performant code in Elixir, you should try reading Tria source, you should try running Tria with <code>TRIA_DEBUG=all</code> env variable to take a look at generated code inside the created <code>tria_generated_context.ex</code> file. It is really interesing.</p>
<p>You can try to take a look at constant folding, at <code>map.field</code> optimizations, at <code>Enum</code> pipes, at inlining, at exception recreation, and so 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="306182" 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/access-optimizations-from-hisssssts-compiler/59347/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-306182" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306182"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="306196" data-post-id="306196">
  <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">
								<aside class="quote no-group" data-username="hst337" data-post="1" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/48.png" class="avatar"> hst337:</div>
<blockquote>
<p>So, if we take a look at the erlang term format, we’ll see that <code>map.key</code> is actually compiled to</p>
</blockquote>
</aside>
<p>That’s inaccurate. We actually compile to:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">case map do
  %{^key =&gt; value} -&gt; value
  ...
end
</code></pre>
<p>So the most common case comes first and the fact <code>map.key</code> is equivalent to <code>remove.function()</code> does not slow down its lookup (except in the cases the key is missing, which raises an exception anyway).</p>
<aside class="quote no-group" data-username="hst337" data-post="1" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/48.png" class="avatar"> hst337:</div>
<blockquote>
<p><code>map.key</code> is the same as <code>map.key()</code> and vice versa, parentheses syntax means nothing here. Live with it</p>
</blockquote>
</aside>
<p>Also inaccurate. We do emit warnings in several occasions, for example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">warning: incompatible types:

    map() !~ atom()

in expression:

    # iex:1
    atom.key

where "atom" was given the type atom() in:

    # iex:1
    is_atom(atom)

where "atom" was given the type map() (due to calling var.field) in:

    # iex:1
    atom.key

hint: "var.field" (without parentheses) implies "var" is a map() while "var.fun()" (with parentheses) implies "var" is an atom()

Conflict found at
└─ iex:1: Foo.remote/1
</code></pre>
<p>And we have been slowly moving towards emit warnings at runtime but we obviously have to be careful towards that.</p>
<p>In any case, I think this is beyond the point. Those are micro-optimizations and you should write code that is clear. If pattern matching is clearer, then certainly do that. For example, I doubt that the change from <code>map.field</code> to pattern matching will yield any measurable improvement on your application response time.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306196" data-batch-url="/posts/batch_likers">
                        6
                      </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/access-optimizations-from-hisssssts-compiler/59347/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-306196" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306196"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="306198" data-post-id="306198">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adw632" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adw632
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for following up to my post with some good information. Much appreciated.</p>
<aside class="quote no-group" data-username="hst337" data-post="13" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/48.png" class="avatar"> hst337:</div>
<blockquote>
<p>My overall expression about your post is that you don’t know anything about the project and that you made several wrong assumptions while reading my posts.</p>
</blockquote>
</aside>
<p>I have not reviewed the full implementation of your compiler but I have found your posts interesting to read, particularly your obversations on performance and how we might go about improving things.</p>
<p>I have seen a few posts that seem to provoke some negative responses from the community, however that may just be my (potentially incorrect) interpretation and reading of how people responded.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306198" 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/access-optimizations-from-hisssssts-compiler/59347/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-306198" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306198"
                     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 #14"></div>
  </section>
</div>
    <div class="postbit" id="306199" data-post-id="306199">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adw632" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adw632
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hst337" data-post="13" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/48.png" class="avatar"> hst337:</div>
<blockquote>
<p>Why is that? And why are sure that collaboration is impossible?</p>
</blockquote>
</aside>
<p>I might be mis reading the tone here, but I sense some adversarial personality traits that may make progress less than optimal, but hopefully not impossible.</p>
<p>Of course I could be completely misreading things yet again.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306199" 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/access-optimizations-from-hisssssts-compiler/59347/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-306199" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306199"
                     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 #15"></div>
  </section>
</div>
    <div class="postbit" id="306218" data-post-id="306218">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I am on the same side with the things said above about shoving the optimizer down the people throats.</p>
<p>It would be nice to see some articles of actually applying it in practice and the real impact on a real project, don’t take me wrong, benchmarks are a good way to measure performance, however for me these are just numbers that mean absolutely nothing, as a lot of times measurements are not made correctly or get influenced by some hardware specific things.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306218" 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/access-optimizations-from-hisssssts-compiler/59347/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-306218" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306218"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="306219" data-post-id="306219">
  <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>Folks, let’s go easy. No one is shoving a compiler down other people’s throats. Perhaps the initial suggestion could have used more disclaimers, but all of the necessary disclaimers are also in the project’s README. <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306219" data-batch-url="/posts/batch_likers">
                        9
                      </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/access-optimizations-from-hisssssts-compiler/59347/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-306219" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306219"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="306221" data-post-id="306221">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hst337" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hst337
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="14" data-topic="59347">
<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>So the most common case comes first and the fact <code>map.key</code> is equivalent to <code>remove.function()</code> does not slow down its lookup (except in the cases the key is missing, which raises an exception anyway).</p>
</blockquote>
</aside>
<p>In this case, clause ordering doesn’t improve the performance. If we take a look at beam, there is type tag lookup and jump based on it’s value.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="14" data-topic="59347">
<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>And we have been slowly moving towards emit warnings at runtime but we obviously have to be careful towards that.</p>
</blockquote>
</aside>
<p>That’s true, I meant that the both constructs execute the same code.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="14" data-topic="59347">
<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>Those are micro-optimizations and you should write code that is clear. If pattern matching is clearer, then certainly do that. For example, I doubt that the change from <code>map.field</code> to pattern matching will yield any measurable improvement on your application response time.</p>
</blockquote>
</aside>
<p>I agree, but I would also mention that there is no point in losing performance, when it can be improved automatically, without having to rewrite anything</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306221" 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/access-optimizations-from-hisssssts-compiler/59347/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-306221" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306221"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="306223" data-post-id="306223">
  <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">
								<aside class="quote no-group" data-username="hst337" data-post="19" data-topic="59347">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/48.png" class="avatar"> hst337:</div>
<blockquote>
<p>I agree, but I would also mention that there is no point in losing performance, when it can be improved automatically, without having to rewrite anything</p>
</blockquote>
</aside>
<p>Sure, if we can optimize, we should. My point is that we can’t fully optimize this yet, as we need to worry about backwards compatibility. It is much easier to optimize if the assumption is that we can break code.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306223" 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/access-optimizations-from-hisssssts-compiler/59347/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-306223" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306223"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="306225" data-post-id="306225">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hst337" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hst337
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>We can optimize it, I made a research!</p>
<p>In all top-100 of popular elixir opensource projects, the <code>module.function</code> is used only about 10 times. And in all of these 10 times, it is used for an already existing module or behaviour. It is never used for module, which is loaded in runtime without behaviour.</p>
<p>So the approach to improve the code was</p>
<ol>
<li>Make all <code>module.function</code> calls with parentheses, just for verbosity.</li>
<li>Use Tria, which would take a look at existing functions and behaviours, and then would decide whether <code>map.field</code> construct can actually be a function call.</li>
</ol>
<p>And this improved the performance of dot in almost every case possible, since behaviours and functions without arguments, but with generic names are not common. Though, one of them is function <code>config</code>, which is found pretty often</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="306225" 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/access-optimizations-from-hisssssts-compiler/59347/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-306225" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="306225"
                     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 #20"></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/59347/load_more?page=3">Load more posts</a>
</div></template></turbo-stream>