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

Eager load in PageTree serializer #2256

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Mar 9, 2022

Eager load pages public version, language and its site.

Before

A 100 pages, 10 levels sitemap

[active_model_serializers] Rendered ActiveModel::Serializer::Null with Alchemy::PageTreeSerializer (5427.42ms)
Completed 200 OK in 5445ms (Views: 5338.8ms | ActiveRecord: 91.6ms | Allocations: 10999091)

After

[active_model_serializers] Rendered ActiveModel::Serializer::Null with Alchemy::PageTreeSerializer (413.06ms)
Completed 200 OK in 445ms (Views: 409.2ms | ActiveRecord: 8.2ms | Allocations: 918201)

This speeds up the page tree by 10!!

Checklist

Eager load pages public version, language and its site.

This speeds up the page tree by 10!!
@tvdeyen tvdeyen requested a review from mamhoff March 9, 2022 14:35
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

🥳

@tvdeyen tvdeyen merged commit 5ad8c0a into AlchemyCMS:main Mar 9, 2022
@tvdeyen tvdeyen deleted the eager-load-page-tree branch March 9, 2022 15:41
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.

2 participants