Skip to content

perf: Prefer GIL-releasing isal over deflate - #126

Closed
nkemnitz wants to merge 1 commit into
seung-lab:masterfrom
ZettaAI:feat/isal-gzip-backend
Closed

perf: Prefer GIL-releasing isal over deflate#126
nkemnitz wants to merge 1 commit into
seung-lab:masterfrom
ZettaAI:feat/isal-gzip-backend

Conversation

@nkemnitz

Copy link
Copy Markdown
Contributor

Single-threaded isal itself already gives a significant speed-boost for compression (3.3x !?) and decompression (1.2x) on my local i7-12700 over deflate, But more importantly, it releases the GIL, no longer blocks the other worker-threads in multi-threaded Python (e.g. CloudVolume).

Wheels are available for all major platforms and CPython versions, but I hid it behind a guard for graceful fallback to deflate, just in case.

@william-silversmith

william-silversmith commented Jun 21, 2026 via email

Copy link
Copy Markdown
Contributor

@william-silversmith william-silversmith added the performance Significantly affects time or space. label Jun 22, 2026
@william-silversmith

Copy link
Copy Markdown
Contributor

I ran my own little benchmark on decompressing a small dataset with cloudfiles. I saw the per hit for isal was 10x deflate, though the total time amounted to only slightly more.

Can you share your benchmark? This might be file size dependent.

@william-silversmith

Copy link
Copy Markdown
Contributor

Oh you know what it probably is? deflate is SIMD and I ran it on segmentation. I suspect you ran it on images. The regularity of segmentation gives a large benefit to SIMD, asm will probably do better on images.

@nkemnitz

Copy link
Copy Markdown
Contributor Author

Checked and can replicate the slowdown on arm64. (Not quite as extreme, but at least 2x). This, and I saw that at fastest compression settings, libdeflate beats igzip in both compression speed, decompression speed and compression ratio for our test data.
Closing this, and will talk to deflate Python wrapper maintainer about GIL release.

@nkemnitz nkemnitz closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Significantly affects time or space.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants