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

PYTHON-4473 Optimize find/aggregate/command by avoiding duplicate calls to _get_topology #1652

Merged
merged 1 commit into from
May 31, 2024

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey
Copy link
Member Author

The benchmarks don't show much improvement but I believe that's because they don't yet cover the case where there's many threads contending for the topology lock.

Locally I see a ~10% improvement on find_one() and ~15% improvement on db.command() on a benchmark with 30-100 threads.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ShaneHarvey ShaneHarvey merged commit 2210f74 into mongodb:master May 31, 2024
30 of 32 checks passed
ShaneHarvey added a commit to ShaneHarvey/mongo-python-driver that referenced this pull request May 31, 2024
ShaneHarvey added a commit that referenced this pull request Jun 1, 2024
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