
60: Compile Faster with Marc-André Lafortune
About this episode
We talk with Marc-André Lafortune about reducing Elixir project compile times. On larger projects, when a single file like a view template is changed and over 100 files get recompiled, there is something wrong. Marc-André explains how he identified the problems in his project and contributed to Elixir’s mix xref tool making it easier for us to find those problems in our own projects! We cover how these tooling improvements were used to improve the upcoming Phoenix 1.6 and Elixir 1.13! An additional mix xref flag was added to run CI checks on our code to prevent accidentally adding code that slows our compile times.
Show Notes online - http://podcast.thinkingelixir.com/60
Elixir Community News
- https://insights.stackoverflow.com/survey/2021#most-loved-dreaded-and-wanted-language-love-dread – Elixir is number 4 among the "most loved" languages on Stack Overflow's developer survey
- https://insights.stackoverflow.com/survey/2021#section-top-paying-technologies-top-paying-technologies – Elixir is number 3 in highest paid languages on Stack Overflow's developer survey
- https://github.com/nvim-treesitter/nvim-treesitter/pull/1645 – Neovim adds tree-sitter (a syntax parser) support for the Surface library
- https://github.com/surface-ui/surface_tailwind/issues/1#issuecomment-884981076 – Surface Catalogue to continue and may redesign the UI using TailwindCSS
- https://github.com/phoenixframework/phoenix/issues/4403#issuecomment-895354673 – Phoenix 1.6 possibly released this week?
Do you have some Elixir news to share? Tell us at @ThinkingElixir or email at [email protected]
Discussion Resources
- https://twitter.com/josevalim/status/1421912595456569351 – Thread talks about the change
- https://groups.google.com/g/elixir-lang-core/c/Hmg5y8S3v4E/m/FVK50RWBAQAJ?pli=1 – Elixir core mailing list where feature was discussed
- https://hexdocs.pm/mix/master/Mix.Tasks.Xref.html#module-understanding-the-printed-graph
- https://github.com/elixir-lang/elixir/pull/11044 – Add "--label compile-connected" option to mix xref graph
- https://github.com/elixir-lang/elixir/pull/11048 – Add "--fail-above" option to mix xref making it good for CI systems
- https://github.com/elixir-lang/elixir/pull/11049 – Support multiple sinks and sources in mix xref graph
- https://github.com/elixir-lang/elixir/pull/11162 – Update docs
- https://github.com/elixir-lang/elixir/pull/11080 – Rely on modification time and hash to determine modified sources
- https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects – Blog post on recompilations
- https://github.com/phoenixframework/phoenix/issues/4408 – Example 1 of sneaky macros introducing compile-time dependencies
- https://github.com/phoenixframework/phoenix/issues/4409 – Example 2 of sneaky macros introducing compile-time dependencies
- https://exercism.io/tracks/elixir
- https://github.com/rbenv/rbenv
- https://rvm.io/
- https://www.super.mx/
- https://xkcd.com/303/
--label compile-connected
--fail-above
Guest Information
- https://twitter.com/malafortune – on Twitter
- https://github.com/marcandre/ – on Github
- http://blog.marc-andre.ca/ – Blog
Find us online
- Message the show - @ThinkingElixir
- Email the show - [email protected]
- Mark Ericksen - @brainlid
- David Bernheisel - @bernheisel
- Cade Ward - @cadebward
More from Thinking Elixir Podcast
The final episode of Thinking Elixir after six incredible years of weekly episodes! We send things off in style with a packed news segment covering Phoenix LiveView 1.2's new colocated CSS powered by…
Elixir v1.20 has officially landed, marking a huge milestone as the language is now officially a gradually typed language, type checking every single line of code without requiring developer annotatio…
Mark shares a bittersweet housekeeping update — the Thinking Elixir Podcast is winding down, with the final episode airing June 23rd, 2026, closing the book on over six years of weekly shows. On the n…
Security takes center stage this week as the EEF's Jonatan Männchen highlights that atom exhaustion accounts for roughly one tenth of all CVEs in the BEAM ecosystem and Sobelow can help catch it befor…
News includes Elixir 1.20.0-rc.6 arriving as likely the final release candidate before v1.20.0 ships, completing a ~15-week roadmap and delivering full type inference across applications and dependenc…