mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-30 11:14:21 +03:00
Python Imaging Library (Fork)
fdd80169fd
Previously there was one memory arena for all threads, making it the bottleneck for multi-threaded performance. As the number of threads increased, the contention for the lock on the arena would grow, causing other threads to wait to acquire it. This commit makes it use 8 memory arenas, and round-robbins how they are assigned to threads. Threads keep track of the index that they should use into the arena array, assigned the first time the arena is accessed on a given thread. When an image is first created, it is allocated from an arena. When the logic to have multiple arenas is enabled, it then keeps track of the index on the image, so that when deleted it can be returned to the correct arena. Effectively this means that in single-threaded programs, this should not really have an effect. We also do not do this logic if the GIL is enabled, as it effectively acts as the lock on the default arena for us. As expected, this approach has no real noticable effect on regular CPython. On free-threaded CPython, however, there is a massive difference (measuring up to about 70%). |
||
---|---|---|
_custom_build | ||
.ci | ||
.github | ||
depends | ||
docs | ||
src | ||
Tests | ||
wheels | ||
winbuild | ||
.clang-format | ||
.coveragerc | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.pre-commit-config.yaml | ||
.readthedocs.yml | ||
CHANGES.rst | ||
codecov.yml | ||
conftest.py | ||
LICENSE | ||
Makefile | ||
MANIFEST.in | ||
pyproject.toml | ||
README.md | ||
RELEASING.md | ||
selftest.py | ||
setup.py | ||
tox.ini |
Pillow
Python Imaging Library (Fork)
Pillow is the friendly PIL fork by Jeffrey A. Clark and contributors. PIL is the Python Imaging Library by Fredrik Lundh and contributors. As of 2019, Pillow development is supported by Tidelift.
docs | |
---|---|
tests | |
package | |
social |
Overview
The Python Imaging Library adds image processing capabilities to your Python interpreter.
This library provides extensive file format support, an efficient internal representation, and fairly powerful image processing capabilities.
The core image library is designed for fast access to data stored in a few basic pixel formats. It should provide a solid foundation for a general image processing tool.
More Information
Report a Vulnerability
To report a security vulnerability, please follow the procedure described in the Tidelift security policy.