Skip to content

Conversation

mroderick
Copy link
Collaborator

This PR makes event rendering slightly faster, by memoising MemberPresenter#organiser? and using it to prevent unnecessary db queries (@user.event_organiser?(event))

This PR overlaps slightly with @jonodrew's work in #2305, which will make this much faster.

Before

image

After

image

This is very unlikely to change during one request, so we can memoise it and gain some speed
This means we won't need to make the sql requests to figure out if the user is organiser or the event
Copy link
Contributor

@jonodrew jonodrew left a comment

Choose a reason for hiding this comment

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

Happy with this. At the same time, I'd like to think about how we can avoid making ActiveRecord queries from within Views where possible

@mroderick
Copy link
Collaborator Author

@olleolleolle @jonodrew could either of you merge this?

@olleolleolle olleolleolle merged commit dbf5c1b into codebar:master Sep 2, 2025
1 check passed
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