Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce compile-time file coupling #979

Merged
merged 2 commits into from Sep 23, 2016
Merged

Conversation

kevsmith
Copy link
Member

This PR removes several cyclic compile dependencies caused by use Cog.Models and use Cog.Queries. Modules, tests, test support modules, and migrations making use of either of these modules have been edited to explicitly alias the models and/or queries used. Cog.Models and Cog.Queries have been deleted as well.

To quantify the impact I measured the number of files compiled after touching Cog.Models.User and the average compile time for 5 compiles. Compilation time was measured with $MIX_ENV=prod, deps precompiled, and mix clean performed before each compile.

  1. Touching Cog.Models.User
    • Before: 197 files
    • After: 138 files
  2. Average compile time
    • Before: 18.7s
    • After: 19.2s

There's definitely more work we can do to further reduce compile-time coupling but I believe this is a good first step.

@kevsmith kevsmith added this to the Cog 0.15 milestone Sep 23, 2016
@kevsmith kevsmith self-assigned this Sep 23, 2016
Copy link
Collaborator

@christophermaier christophermaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kevsmith kevsmith merged commit cc1cf5c into master Sep 23, 2016
@kevsmith kevsmith deleted the kevsmith/less-compile-coupling-1 branch September 23, 2016 15:44
@kevsmith kevsmith removed the review label Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants