Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pleroma pleroma
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 592
    • Issues 592
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Pleroma
  • pleromapleroma
  • Issues
  • #2651
Closed
Open
Created May 19, 2021 by Alex Gleason@alexgleasonContributor

Speed up recompilation time

At some point, something happened that made the entire router need to get recompiled whenever a single controller or view is edited:

➜  soapbox git:(recompilation) ✗ mix compile
➜  soapbox git:(recompilation) ✗ touch lib/pleroma/web/mastodon_api/views/instance_view.ex      
➜  soapbox git:(recompilation) ✗ mix compile
Compiling 173 files (.ex)
Compiling lib/pleroma/web/router.ex (it's taking more than 10s)

When I first got into Pleroma dev I assumed this was a normal part of the language, but after coding my own stuff in Elixir I realized it wasn't. Editing a view should result in 1 file being recompiled, and it should take about 1 second. Right now it takes 30 seconds at least, sometimes more.

This makes it difficult for people to contribute to Pleroma, which could potentially stifle its growth. If fixed, it will make development easier for all of us in the long term. It's a personal priority of mine to fix because of the long-term gains.

Resources:

  • Understanding and fixing recompilation in Elixir projects — https://szajbus.dev/elixir/2020/04/14/understanding-and-fixing-recompilation-in-elixir-projects.html

  • Speeding up re-compilation of Elixir projects — https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects

  • Elixir Forum: Modifying a controller recompiles my router and all UI layer — https://elixirforum.com/t/modifying-a-controller-recompiles-my-router-and-all-ui-layer/24105

  • ElixirConf 2018 - Understanding Elixir's Re compilation (YouTube) — https://www.youtube.com/watch?v=hqaxMZAwbBA

  • mix xref docs — https://hexdocs.pm/mix/Mix.Tasks.Xref.html

Edited May 20, 2021 by Alex Gleason
Assignee
Assign to
Time tracking