There is no way to patch out Mix.Utils to run your own code. The proper fix
would be to figure out why the path traversal is slow on Elixir (it is
implemented on top of filelib:wildcard) so we can fix it rather
permanently. How long does "Path.wildcard("lib/**/*.ex")" take? Can you
implement your own path traversal in Elixir? Is it faster than
Path.wildcard?


*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D


On Mon, Oct 14, 2019 at 8:08 PM Michael St Clair <[email protected]>
wrote:

> I've been doing some digging around to see how to make phoenix run faster
> in Docker. Without this plug the app runs just as fast as native
> `plug(Phoenix.CodeReloader`. I think I have traced it down to this
> https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/utils.ex#L237.
> Running just that function explains most if not all of the extra load time
> on my endpoints. However this code `"ls lib/**/*.ex" |>
> String.to_charlist() |> :os.cmd() |> to_string() |> String.split("\n") |>
> IO.inspect` appears to do the same thing and much faster. I'm just running
> into the problem of how to override that Mix.Utils file to test it here
> https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/compilers/elixir.ex#L36.
> Any suggestions?
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/b811d808-04a2-427e-9281-3d337f05de16%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/b811d808-04a2-427e-9281-3d337f05de16%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J6qRZachqkVpDZKsryq208mJ-ruOdcn0X_TmmjU6%3D7Cg%40mail.gmail.com.

Reply via email to