This turned out to be quite a large PR as I took this moment to refactor a lot of the compression code and optimize the way the PhotoshopAPI internally compresses and decompresses data by reusing a swap buffer rather than reallocating buffers only to discard them away later.
Additionally we now use libdeflate rather than zlib_ng for compression and decompression as this allows for much greater decompression speeds. We also added memory-mapped files for read operations as this provided significant improvement in read performance.
Overall the speedups are:
~40% in 8-bit reads, ~20% in 8-bit writes.
~20% in 16-bit reads, ~10% in 16-bit writes.
~-5% in 32-bit reads, ~7% in 32-bit writes.
While 32-bit reads did get slightly slower with our benchmark data we did see speedups in all other cases which justifies this change. I will look into equalizing 32-bit read speeds in the future
This turned out to be quite a large PR as I took this moment to refactor a lot of the compression code and optimize the way the PhotoshopAPI internally compresses and decompresses data by reusing a swap buffer rather than reallocating buffers only to discard them away later.
Additionally we now use libdeflate rather than zlib_ng for compression and decompression as this allows for much greater decompression speeds. We also added memory-mapped files for read operations as this provided significant improvement in read performance.
Overall the speedups are:
While 32-bit reads did get slightly slower with our benchmark data we did see speedups in all other cases which justifies this change. I will look into equalizing 32-bit read speeds in the future