W
woodbrian77
I've been moving away from marshalling uses where an
instance of a class is marshalled out of one program
and later marshalled in to another program. In one
case the input is from the command line and it is
needless overhead to construct an object just so it
can be marshalled. In another case the input is coming
from a config file and again I don't (at least so far)
have a need to construct an object just so it can be
marshalled out. One question I have is if others have
or are dealing with something like this?
These two files are for the second case with the config
file.
http://webEbenezer.net/misc/cmw_user_input.hh
http://webEbenezer.net/misc/cmw_user_input.cc
I'm thinking about introducing another class and
moving some of the functionality that's in there now
to that new class. Specifically I may move the ctor
that takes char*, the char* data member and the Marshal
member function. Comments on naming that class are
welcome. Getting that char* data member out of
cmw_user_input would be helpful because it would mess
up the code generation of the marshalling ctor.
To review in one case I marshall multiple command line
args in a message (as multiple function args) and the
other side receives all of that as a class instance.
And in the second case I'd be marshalling one (related)
type and receiving it as a different type.
The marshalling-out code currently looks like this:
remoteMessages.Marshal(cmwSendbuf
,request.accountNbr
,cmw_user_input(request.filename)
);
but I may change that to use the new class mentioned
above.
This is efficiency motivated. Changing from building
the object from the config file and then marshalling
it, to marshalling it straight away reduced the size
of my text segment by 2% on gcc and 1% with clang.
The gcc result seems more impressive because gcc was
already producing a smaller text segment than clang.
Tia for your comments on this asymmetry. I'm not sure
what if anything can be done automation-wise or
convention-wise to keep the two sides in sync.
Brian
Ebenezer Enterprises - John 3:16
http://webEbenezer.net
instance of a class is marshalled out of one program
and later marshalled in to another program. In one
case the input is from the command line and it is
needless overhead to construct an object just so it
can be marshalled. In another case the input is coming
from a config file and again I don't (at least so far)
have a need to construct an object just so it can be
marshalled out. One question I have is if others have
or are dealing with something like this?
These two files are for the second case with the config
file.
http://webEbenezer.net/misc/cmw_user_input.hh
http://webEbenezer.net/misc/cmw_user_input.cc
I'm thinking about introducing another class and
moving some of the functionality that's in there now
to that new class. Specifically I may move the ctor
that takes char*, the char* data member and the Marshal
member function. Comments on naming that class are
welcome. Getting that char* data member out of
cmw_user_input would be helpful because it would mess
up the code generation of the marshalling ctor.
To review in one case I marshall multiple command line
args in a message (as multiple function args) and the
other side receives all of that as a class instance.
And in the second case I'd be marshalling one (related)
type and receiving it as a different type.
The marshalling-out code currently looks like this:
remoteMessages.Marshal(cmwSendbuf
,request.accountNbr
,cmw_user_input(request.filename)
);
but I may change that to use the new class mentioned
above.
This is efficiency motivated. Changing from building
the object from the config file and then marshalling
it, to marshalling it straight away reduced the size
of my text segment by 2% on gcc and 1% with clang.
The gcc result seems more impressive because gcc was
already producing a smaller text segment than clang.
Tia for your comments on this asymmetry. I'm not sure
what if anything can be done automation-wise or
convention-wise to keep the two sides in sync.
Brian
Ebenezer Enterprises - John 3:16
http://webEbenezer.net