-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Perf: batch site.get() calls across 6 N+1 hotspots (refs #12432) #12748
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
Open
WeiGuang-2099
wants to merge
22
commits into
internetarchive:master
Choose a base branch
from
WeiGuang-2099:finalsubmit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e84146c
Find all locations of web.ctx.site.get() and whether they are called …
Winterhuli 0910ea0
replace per-loan site.get with site.get_many
Winterhuli 8036a9b
fix(api): replace list comprehension web.ctx.site.get(key) with get_m…
WeiGuang-2099 c4a1a99
Merge pull request #1 from WeiGuang-2099/Cheng
Winterhuli bb14d0b
Delete N+1 queries.txt
Winterhuli 0af2fef
Merge pull request #2 from WeiGuang-2099/yuheng
Winterhuli ef3d073
Batch load works in get_observations using get_many
Hussain5001 11fed38
Merge pull request #3 from WeiGuang-2099/hussain
WeiGuang-2099 3dd00c0
Batch note page lookups in mybooks
MuchiniGun 6c42073
Merge pull request #4 from WeiGuang-2099/owen
Hussain5001 b97ff2e
Merge branch 'master' into finalsubmit
WeiGuang-2099 c0478d9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 53172e8
Update openlibrary/plugins/openlibrary/api.py
WeiGuang-2099 7e2dbd8
Implemented the mybooks suggestions:
MuchiniGun 6d96026
Updating the remaining changes
MuchiniGun 8286b6a
fix: avoid relying on get_many result order in mybooks
Winterhuli a4807d6
Avoid N+1 work fetches in bulk tag and reading log stats
WeiGuang-2099 22e2a59
Merge pull request #7 from WeiGuang-2099/yuheng
WeiGuang-2099 54ae068
Merge branch 'master' into finalsubmit
WeiGuang-2099 17a9045
Merge branch 'finalsubmit' into Cheng
WeiGuang-2099 a457177
Merge pull request #8 from WeiGuang-2099/Cheng
WeiGuang-2099 85822dc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial idea was just to avoid making empty
get_many([])calls when there are no notes, but I see it's unnecessary since the normal batch flow handles empty notes. I will remove the guard.