-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
tuning for maximum performance #191
Comments
Filtering is still enabled which will slow things down, what options are passed to |
Unless there's another option I have missed, it should be set to ihdr.compression_method = 0
ihdr.filter_method = SPNG_FILTER_NONE
ihdr.interlace_method = SPNG_INTERLACE_NONE
Good question! I'm not exactly sure since it is used through This is kind of one of the key reasons for wanting to use |
That enum is not meant for that field, the only valid value for For filter method 0 there are 5 filter types, try reducing it to 2 with If the options don't match exactly then performance won't be comparable, not only filtering has its overhead but compression speed is affected by it. |
Oh! Good thing I asked!
Thanks for the hint!
That's OK, I understand. Thank you for your help. |
I am using
libspng
to compress my RGB(A) pixel data and after following the code and some empirical testing (mostly to validate those choices), I came up with these settings:SPNG_IMG_COMPRESSION_LEVEL=1
SPNG_TEXT_WINDOW_BITS=15
SPNG_IMG_COMPRESSION_STRATEGY=Z_HUFFMAN_ONLY
SPNG_IMG_MEM_LEVEL=MAX_MEM_LEVEL
You can see these settings in the cython encoder source here:
https://github.com/Xpra-org/xpra/blob/76ae51d77dd477c5e53e4547ae84fecea7fc0e8b/xpra/codecs/spng/encoder.pyx#L175-L191
Unfortunately, when comparing the performance of this Cython module with Python-pillow, using this trivial test tool: Xpra-org/xpra@4fd50ba, I found that
libspng
compresses very consistently at around 4MPixels/s whereaslibpng
achieves 8 to 16MPixels/s on my i6700K.What am I doing wrong?
(this is on Fedora 34 with libspng git master)
The text was updated successfully, but these errors were encountered: