glennmatthews / cot

Common OVF Tool
MIT License
90 stars 23 forks source link

Allow batch operations to reduce repeated file read/write cost #22

Open glennmatthews opened 9 years ago

glennmatthews commented 9 years ago

The slowest part of COT is the actual file I/O [citation needed], especially when untarring and retarring an OVA file is required. This makes multi-stage operations like the following somewhat slow since the file is re-written and re-read repeatedly:

cot edit-hardware foo.ova --cpus 4
cot edit-properties foo.ova ...
cot inject-config config.txt foo.ova
cot info foo.ova

While COT is explicitly designed around separation of actions (so that the params defined for "edit-hardware" do not conflict with the params for "add-disk", etc.), it would be nice to provide for some mechanism of batching operations together with only a single "read" at the beginning and a single "write" at the end.

glennmatthews commented 9 years ago

http://stackoverflow.com/questions/10448200/how-to-parse-multiple-sub-commands-using-python-argparse may be relevant

glennmatthews commented 9 years ago

This should be less of an issue if #39 is fixed to reduce unnecessary copies/read/write operations.