pillow-simd icon indicating copy to clipboard operation
pillow-simd copied to clipboard

How to get known which optimisations are used ?

Open socketpair opened this issue 9 years ago • 4 comments

I just executed command pip3 install Pillow-SIMD. Now, my thumbnailer works right.

Question: How I can know which SIMD operations sets are really used ?

I did not notice speedup...

socketpair avatar Jul 11 '16 21:07 socketpair

See installation section. By default SSE4 is used.

I did not notice speedup...

Could you show the code?

homm avatar Jul 11 '16 22:07 homm

You can ensure that SIMD version is installed:

$ python -c "from PIL import Image; print(Image.PILLOW_VERSION)"
3.2.0.post3

If PILLOW_VERSION has postfix, it is SIMD.

homm avatar Jul 11 '16 22:07 homm

  1. code just creates thumbnails and nothing more.
  2. Yes, I have installed SIMD version, I have checked.
  3. I will measure performance.

It will be nice if I have Python API to get actual optimisation level. i.e. PIL.get_SIMD_level() returning one of, 'Vanilla', 'SSE4', 'SSE4+AVX2'. Or, in Python 3, Enum instead of strings.

socketpair avatar Jul 12 '16 11:07 socketpair

$ python -c "from PIL import Image; print(Image.PILLOW_VERSION)"

This does not work with 7.0.0.post3, but might work with some future versions, because of the constant depreciation iterations:

PILLOW_VERSION has been deprecated and will be removed in a future release. Use __version__ instead. It was initially removed in Pillow 7.0.0, but brought back in 7.1.0 to give projects more time to upgrade.

This should work:

$ python -c "from PIL import Image; print(Image.__version__)"

adyomin avatar Aug 11 '20 08:08 adyomin