Skip to content

Conversation

thejohnhoffer
Copy link

@thejohnhoffer thejohnhoffer commented Jan 26, 2023

This resolves issue #347. The _bulkReadable function detects when a single read should match an IFD buffer byte-for-byte. Instead of extracting every single pixel individually, this PR copies the IFD buffer to a single typed array whenever possible.

For our test case loading unsigned 16-bit 1024x1024 tiles, I observe this optimization is 4x faster thanv2.0.7.

I have written the code to optimize only when possible:

  • Requesting a single non-interlaced tile without color planes
  • Ensuring the byte order of the device matches the image byte order

Testing

  • I have not yet tested with multiple formats / byte counts.
  • I have not yet tested on a big endian OS.

@potion-cellar
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants