Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate file I/O for draco encode step #1

Open
stuarteberg opened this issue Oct 25, 2017 · 0 comments
Open

Eliminate file I/O for draco encode step #1

stuarteberg opened this issue Oct 25, 2017 · 0 comments

Comments

@stuarteberg
Copy link
Member

Currently, mesh_from_array() relies on two external command-line tools (fq-mesh-simplify and draco_encoder), both of which use filepaths for input and output (not streams). A naïve implementation would incur the cost of disk I/O several times:

  1. mesh_from_array() writes the raw .obj to disk
  2. fq-mesh-simplify reads the raw .obj from disk
  3. fq-mesh-simplify writes the simplified .objto disk
  4. draco_encode reads the simplified .obj from disk
  5. draco_encode writes the compressed .drc to disk
  6. mesh_from_array() reads the compressed .drc from disk

Fortunately, most of those I/O costs are avoided in mesh_from_array() by using unix "named pipes" to write and read the data. Unfortunately, steps 3. and 4. could not be avoided: draco_encode requires a seekable stream (for no good reason, IMHO), which means we're forced to use the hard disk.

The only way to eliminate that last I/O penalty is to implement our own version of draco_encode, or to implement python bindings for the draco::Encoder C++ class.

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

No branches or pull requests

1 participant