Skip to content

Conversation

@Nutomic
Copy link
Member

@Nutomic Nutomic commented Nov 11, 2025

Move db joins into separate crates so they can be compiled in parallel with db_schema. This reduces build time by ~8s on my computer. In theory we could move even more sql logic into those crates.

Before:
Screenshot_20251111_130651


After:
Screenshot_20251111_130640

@Nutomic Nutomic force-pushed the parallel-compile-joins branch from 2cfe3de to a607c49 Compare November 11, 2025 12:24
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

I have a feeling this is going to conflict with some existing PRs, so lets do them in order before merging this

};

#[diesel::dsl::auto_type(no_type_alias)]
pub fn notification_joins(person_id: PersonId, instance_id: InstanceId) -> _ {
Copy link
Member

Choose a reason for hiding this comment

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

Seems fine to me. Might be a little weird to spread out join and query logic into different crates, but I don't have a problem with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory it should also be possible to move the entire query logic into this crate and pass in NotificationView as generic parameter to speed up compilation even more. But its very complicated to make that work. Or for count it should be easy to move it here as it doesnt require NotificationView.

Copy link
Member

@dessalines dessalines Nov 12, 2025

Choose a reason for hiding this comment

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

Looking at a recent CI run, cargo test is now the slowest item. I don't think there's been too much progress on #5846 but that's the next speed bottleneck.

@dessalines dessalines merged commit c6f2eea into main Nov 12, 2025
2 checks passed
@dessalines dessalines deleted the parallel-compile-joins branch November 12, 2025 16:27
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.

3 participants