ImageEngine/gaffer — pull request #765 by johnhaddon (2014-03-03 17:01:04+00:00)
Title: Combined setValue() serialisation for CompoundNumericPlugs

This implements #761. It hasn't had a huge impact on file size or load times though - approaching 4% and 2% savings respectively for a certain monster production file. It also specifies values in less precision than before as a result of using the __repr__ for V3f etc rather than the __repr__ for the python built in double type. If that's something we're worried about (I think it should be) then I think we should probably reimplement __repr__ for Vec and Color types in the IECore bindings to have improved precision - a bit or reading around seems to imply that boost::lexical_cast does a bunch of shenanigans to ensure reasonable round tripping between float and decimal representation, and might not be as horrifically slow as it has been in the past…

It's possible that we might see bigger improvements in other sorts of file - the file content in my test case is dominated by addChild() calls when adding dynamic plugs for shaders, so files with fewer dynamic plugs and more non-default values might see a bigger improvement.

It's also arguable that the new format is more human readable than the previous, by putting colour values in one place rather than split over three lines.

What do you reckon? It's a bit underwhelming...