-
Notifications
You must be signed in to change notification settings - Fork 33
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
pgmagick doesn't release GIL #35
Comments
Hi, I believe there is a way to make it work using wrapper approach displayed in https://stackoverflow.com/a/18648366/5097156. It is nice, that it allows specifying functions, that should release GIL - so you don't pay the cost for releasing and obtaining GIL for every call to pgmagick. If this will work, we should decide:
|
Hi, # python3 setup.py build
# PYTHONPATH=build/lib.linux-x86_64-3.5/ python3 test/gil.py /tmp/test_image.jpg
>>> deferred_noop time: 0.202s 161 switches
>>> deferred_pillow time: 0.851s 657 switches
>>> deferred_pgmagick time: 0.649s 40 switches |
That's cool! Thanks for the update. |
@hhatto |
It is a very good point, and this wip changeset is cool.
In my opinion, I think that this is good solution. for example:
But, I can not afford to implement it, now 😭 Patches welcome 😃 |
The idea is that image processing library could release global interpreter lock on heavy computing when it isn't interacting with python's interpretation structures. Most of the python libraries do this, while pgmagick doesn't.
This is the test case:
And my results:
The text was updated successfully, but these errors were encountered: