Skip to content

perf: faster decoding for binary images w/ verified=False - #71

Merged
william-silversmith merged 4 commits into
mainfrom
wms_binary_image_decode
Nov 5, 2026
Merged

william-silversmith merged 4 commits into
mainfrom
wms_binary_image_decode

Conversation

@william-silversmith

@william-silversmith william-silversmith commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

If we are allowed to skip the crc32c check, we can exploit the structure of the vcg for binary images to avoid creating a uint32 CCL plane. This reduces memory consumption and results in faster rendering.

Because this requires skipping a safety check, it is opt in.

On smaller images this didn't make a big impact, but I was rendering hundred of slices of a binary mask at a time that was taking over 6 seconds per render and it went down to a bit over 5. I measured the difference as ~3900 MVx/sec -> ~4500 MVx/sec on my Macbook Pro M3.

@william-silversmith william-silversmith self-assigned this Nov 5, 2026
@william-silversmith william-silversmith added the performance Affecting space or time. label Nov 5, 2026
@william-silversmith
william-silversmith merged commit fefe1c9 into main Nov 5, 2026
15 checks passed
@william-silversmith
william-silversmith deleted the wms_binary_image_decode branch November 5, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Affecting space or time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant