forked from apache/cassandra-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 60
perf: optimize Tablet memory layout and per-query lookup speed #812
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
mykaul
wants to merge
8
commits into
scylladb:master
Choose a base branch
from
mykaul:perf/tablets-memory-and-lookup
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
8 commits
Select commit
Hold shift + click to select a range
4c9c555
perf: add __slots__ to Tablet to eliminate per-instance __dict__
mykaul 7b9075d
perf: store Tablet.replicas as tuple instead of list
mykaul 9995ea2
perf: cache _replica_dict on Tablet for O(1) host/shard lookup
mykaul 1883e1d
perf: streamline Tablet.from_row by inlining validation
mykaul b98e7f1
perf: eliminate bisect key= callback via parallel token index lists
mykaul 5f62bca
perf: batch-filter drop_tablets_by_host_id instead of triple pop
mykaul a7c9dd9
perf: avoid redundant tablet lookup in shard-aware connection selection
mykaul f34c45c
fix: update response_future tests for borrow_connection tablet= kwarg
mykaul 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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Already addressed in this PR: cluster.py's
ResponseFuture._make_query_plan()now unconditionally clearsquery._tablet = Noneat the top, before branching onself._hostor calling the load balancer (added in commit a7c9dd9, after this review was posted against an earlier commit). That covers the explicit-host branch and any non-token-aware policy switch you describe, since_make_query_plan()runs once perResponseFuture/execution and is the sole gate before the only read site (cluster.py'sborrow_connection(..., tablet=getattr(self.query, '_tablet', None))). Traced all set/read sites (policies.py:563,586,631 and cluster.py:4911/5063) — no other path reads this field. Verified with a regression test exercising the explicit-host branch with a pre-set stale tablet.