Uploaded image for project: 'OpenVDB'
  1. OpenVDB
  2. OVDB-91

OpenVDB Delayed Load Metadata

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • Core
    • None

      OpenVDB delay-loading provides a big benefit in terms of memory usage, however doesn't offer faster performance. Fast I/O performance relies on being able to do a seek through large sections of the file instead of a read, as physically moving the disk head is very slow. Even using solid state drives, there is still a significant latency in retrieving small portions of the file spaced at regular intervals.

      While OpenVDB I/O has mostly been converted to use seek instead of read, there are still two areas where that's not the case:

      • mask compression bytes - these are the single bytes stored at the head of each leaf node to indicate whether we are storing all the values, just one active value, etc. It's a very effective compression scheme, but doesn't work well with delayed-loading.
      • value compression sizes - when using Blosc (the default) or Zip compression, the size of the resulting compressed buffer is stored at the front of each buffer.

      Without changing the file format, the easiest solution to the above is to do a pre-pass of the grid due to be written out in Archive::writeGrid() and to insert a new DelayedLoadMetadata that stores Blosc compressed arrays of the mask compression and value compression data.

      I expect this to be a relatively small increase in file size and a relatively small decrease in file write performance (I shall attempt to demonstrate this) so that it can be always enabled. The other main benefit in using this approach is that it is a backwards and forwards file format compatible change, as older versions of OpenVDB will ignore the metadata and newer versions are able to take advantage of it.

      There's a fair bit of refactoring required to introduce this functionality, but I think it's a worthwhile change.

            danrbailey danrbailey
            danrbailey danrbailey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: