Skip to content

#1664: add reactions cache to reduce N+1 API calls#1771

Open
VasilevNStas wants to merge 2 commits into
zerocracy:masterfrom
VasilevNStas:1664-n1-reactions
Open

#1664: add reactions cache to reduce N+1 API calls#1771
VasilevNStas wants to merge 2 commits into
zerocracy:masterfrom
VasilevNStas:1664-n1-reactions

Conversation

@VasilevNStas

@VasilevNStas VasilevNStas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Adds an instance variable cache (@reactions) in Jp.count_appreciated_comments to avoid N+1 API calls when the same comment reactions are looked up multiple times for the same pull request.

The cache is keyed by comment ID and memoizes the result of issue_comment_reactions and pull_request_review_comment_reactions.

Closes #1664

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 plz review this PR

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.

N+1 reactions API calls in lib/pull_request.rb count_appreciated_comments

1 participant