Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.4k
Possible pluggable C extension for performance#1066
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
kesmit13 wants to merge15 commits intoPyMySQL:mainChoose a base branch fromsinglestore-labs:main
base:main
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.
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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.
I'm creating this PR more as a start to a conversation as opposed to a request that I expect to be accepted any time soon. We like being able to use PyMySQL because of the ease of installation and the fact that it can be used without any system-level libraries being installed. However, the performance leaves a lot to be desired when dealing with larger result sets.
After some investigation, it looked like most of the time was being spent in the row data fetching and data conversion, which all stems from one method in the connection (`read_rowdata_packet'). An idea came to mind to replace that method (and anything that it calls) with a C extension to see how much performance could be increased. It ended up working much better than expected and the performance improvements actually made the client (arguably) the fastest MySQL Python client available (arguably because the Mariadb client is pretty fast too). It is definitely the fastest Python client that doesn't require any external libraries to run.
I thought I'd bring the work up to your team to see if you might want to collaborate on it as a possible plugin for PyMySQL, or to see if it should remain a separate project.