Hi Robert,

2009/12/19 Robert Osfield <[email protected]>:
> Hi Wang,
>
> Wow, that was a quick turn around.  I've begun a code review, and so
> far am impressed as how much code you've been able to share between
> the binary + ascii implementations.  I do wonder about the performance
> impact on binary reading that there will be due to adding all the if
> statements that are required for ascii support.  Have you performacne
> profiled the new plugin against your previous one or the .ive plugin?

I didn't have a performacne test but I guess there will surely be
efficiency loss while loading binary files with the existing bin
plugin.

> In reviewing the wrappers I do wonder if we might be able to wrap the
> individual properties as objects in their own right, with each of
> these mini classes handling the reading and writing of that specific
> property, then the classes wrappers just containers for this property
> wrapper classes.  I experimented with such an approach in
> VirtualPlanetBuilder's src/vpb/BuildOptionsIO.cpp.  This approach
> extends the standard .osg format in a very compact way that is far
> less error prone and verbose that usual DotOsgWrappers.  This approach
> does use lots of templates and macros though.  To get a taste have a
> look at how I wrapped the BuildOptions class that has dozens of
> separate properties of different types:
>

I'm going to look into the VPB source code these days. In fact I
haven't explored this project before, although I'm using it every day.
:)

> The above provides all the read and write support, with the properties
> being access via Type CLASS::getPROPERTYNAME() and void
> CLASS::setPROPERTYNAME(Type) methods, with macro's adding the
> get's/set's and types automatically.
>
> The VPB code doesn't support binary and ascii, and I haven't profiled
> how expensive it is in memory or speed, for ascii support I would
> expect it be pretty competitive to the standard OSG ascii, but for
> binary I guess it would fare less well w.r.t .ive.
>

I think it will always be inefficient for a binary format if we parse
property names and values in runtime, because of these excess parsing
functions. Maybe we could just use templates and macros to implement
ascii/binary support in the compile time instead. I will read the VPB
source code through first and try to make some thoughs if possible.

Cheers,

Wang Rui
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to