Re:Give me back my monolith (2019)
by sergiotapia on Tuesday May 10, 2022 @12:42PM
(#31329212)
Warning: Compilation times suck for Elixir/Erlang. I'm frustrated almost daily when I make changes to my code and have to wait for 66 .ex files to compile after changing one single line of code in a heex template.
[ Parent
| on HN ]
Why do the other files get recompiled? they should be recompiled only if there is change in them.
Re:Give me back my monolith (2019)
by sergiotapia on Tuesday May 10, 2022 @12:57PM
(#31329414)
I have no idea. That's what I'm seeing when working with my project.
Literally add one character to one of my liveview modules:
Rebuilding...
Compiling 67 files (.ex)
Re:Give me back my monolith (2019)
by tomjakubowski on Tuesday May 10, 2022 @01:55PM
(#31330174)
It's worth your time to investigate this, it's fixable. Check out mix xref to investigate dependency chains between files in your mix project.
In the project I work on, it turned out a module `use`d by almost every controller included a function (totally unused, btw) which, through a little bit of indirection, caused a circular compile-time dependency between all of them. So any change to any controller caused hundreds of files to rebuild.
Re:Give me back my monolith (2019)
by sergiotapia on Tuesday May 10, 2022 @02:37PM
(#31330809)
Never heard of xref. I'll take a look thanks!
Re:Give me back my monolith (2019)
by devoutsalsa on Tuesday May 10, 2022 @01:43PM
(#31329993)
Probably macros.
Re:Give me back my monolith (2019)
by pablodavila on Tuesday May 10, 2022 @03:48PM
(#31331740)
This was improved in a recent release. Did you try with the latest version?