Interesting! I always forget elixir modules are also "just" evaluated until 
I don't. `mix run --no-start` does indeed seem to work for this use case!

Thank you!

On Thursday, February 23, 2023 at 11:20:01 AM UTC+1 José Valim wrote:

> Could you potentially use `mix run lib/my_file.ex` for those cases?
>
> On Thu, Feb 23, 2023 at 10:27 AM Tobias Pfeiffer <pra...@gmail.com> wrote:
>
>> Hi everyone and as always, thanks for your amazing work!
>>
>> Jokes have been lobbied at me in the spirit of the "breaks my worlfow" 
>> XKCD [1]  - but, please here me out!
>>
>> Since the (amazing!) 1.13 [2] elixir semantic recompilation changes I 
>> can't easily force recompilation on single files.
>>
>> The best I know how, is adding empty comments to the files. That is fine 
>> for single tries. However, for those who know me, I like benchmarking. 
>> Particularly, I'd like to use something like hyperfine [3] to benchmark the 
>> compilation. I could write scripts to add/remove comments in between but it 
>> seems clumsy. 
>>
>> I might be missing a variant to get this done here.If so, I apologize for 
>> not first going to elixirforum.
>>
>> As for _why_ do I want to do this: I have 3 implementations of the same 
>> module. I'd really like to compare the impact of the implementation on 
>> compilation time (one generates a bunch of functions to pattern match, the 
>> other one just uses a map, there is one variant which also does a file 
>> read) to provide general guidance on the impact.
>>
>> I had hoped that I could do `mix compile --force lib/my_file.ex`, but it 
>> always compiles everything. Enabling this interface would be my proposal to 
>> remedy this, but y'all might have better ideas or tell me it's not worth it 
>> :)
>>
>> Cheers + thanks,
>> Tobi
>>
>> [1] https://xkcd.com/1172/
>> [2] https://hexdocs.pm/elixir/1.13/changelog.html#semantic-recompilation
>> [3] https://github.com/sharkdp/hyperfine
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elixir-lang-co...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/97956f7b-f789-4b9f-94e3-c3b1bda462d0n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elixir-lang-core/97956f7b-f789-4b9f-94e3-c3b1bda462d0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/cbeea434-3645-4692-acbe-558f17b333een%40googlegroups.com.

Reply via email to