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

Use cPickle with Python 2 again, to fix v1.54 performance regression #86

Merged
merged 1 commit into from
May 26, 2016
Merged

Use cPickle with Python 2 again, to fix v1.54 performance regression #86

merged 1 commit into from
May 26, 2016

Conversation

edmorley
Copy link
Contributor

@edmorley edmorley commented Jan 7, 2016

Some Python 3 compatibility changes made python-memcached import pickle rather than cPickle, since the latter isn't available on Python 3:
4540332

This is fine on Python 3, since importing pickle will automatically use the faster C implementation if available, however with Python 2 this caused a 400% slowdown in memcache gets between python-memcached v1.53 and v1.54, when dealing with objects other than bytes.

This mostly fixes #71, though there is still a 10-20% performance drop using current master plus this change, compared to v1.53 (using Python 2.7.10).

Some Python 3 compatibility changes made python-memcached import pickle
rather than cPickle, since the latter isn't available on Python 3:
4540332

This is fine on Python 3, since importing pickle will automatically use
the faster C implementation if available, however with Python 2 this
caused a 400% slowdown in memcache gets between python-memcached v1.53
and v1.54, when dealing with objects other than bytes.

This mostly fixes #71, though there is still a 10-20% performance drop
using current master plus this change compared to v1.53 (using Python
2.7.10).
@edmorley
Copy link
Contributor Author

edmorley commented Mar 4, 2016

@linsomniac, I don't suppose you've seen this PR? :-)

@edmorley
Copy link
Contributor Author

@linsomniac ping? :-)

@linsomniac
Copy link
Owner

Thanks for this change, sorry for the delay in looking at it. Merging.

@edmorley edmorley deleted the python2-pickle-perf branch May 29, 2016 19:26
@edmorley
Copy link
Contributor Author

Thank you for merging :-)

nijel added a commit to WeblateOrg/docker that referenced this pull request Jan 30, 2018
This way we get more recent version which doesn't suffer performance
issues on Python 2.

See linsomniac/python-memcached#86

Signed-off-by: Michal Čihař <michal@cihar.com>
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.

Performance drop between v1.53 and v1.54
2 participants