cjk
Very long compile times for small changes
Hi there,
I am currently working on a Forum/community system in Elixir using Phoenix. First everything was nice, but slowly the compile times increased. It got so bad that now small changes can take up to 30 seconds.
I already read about compile dependencies and stuff, but I can’t really make sense of tools like mix xref. The generated graphic is unusable (image viewers seem not to be able to show the image) and the tree/stats views are confusing to me.
I already tried to fight this problem by stripping out imports and requires, and it made things better – but by far not good.
Can somebody point me to resources explaining how to use tools like mix xref or explain me what I am doing wrong?
My project is a FLOSS and hosted on Github: https://github.com/ckruse/cforum_ex/
Edit: also please don’t mince matters. If you think I am using anti patterns and thus causing this problem myself, tell me. I can handle that and love to learn.
Thanks in advance,
CK
Most Liked
josevalim
Phoenix v1.4 comes with improvements in this area. Do these steps:
- https://gist.github.com/chrismccord/bb1f8b136f5a9e4abc0bfc07b832257e#add-a-routes-alias-and-update-your-router-calls
- Add
config :phoenix, :plug_init_mode, :runtimeto yourconfig/dev.exs
cjk
No, it doesn’t. But it works on layout_view.ex – but I don’t understand the results.
➜ ckruse@Pug ~/Code/selfhtml/cforum_elixir (master) ✗ % mix xref graph --label compile --sink lib/cforum_web/views/layout_view.ex
lib/cforum_web/mailers/notification_mailer.ex
└── lib/cforum_web/views/layout_view.ex (compile)
lib/cforum_web/mailers/user_mailer.ex
└── lib/cforum_web/views/layout_view.ex (compile)
➜ ckruse@Pug ~/Code/selfhtml/cforum_elixir (master) ✗ % touch lib/cforum_web/views/layout_view.ex
➜ ckruse@Pug ~/Code/selfhtml/cforum_elixir (master) ✗ % mix compile
Compiling 106 files (.ex)
When only two files compile-time depend on layout_view.ex, why does a change cause 106 files to be recompiled?
hlx
Did you try deleting the _build folder? Whenever I have the slightest problem I always first delete _build, deps and .elixir_ls







