[Ns-developers] A Reason for Slowness of NS3
craigdo at ee.washington.edu
Sat Feb 14 20:30:23 PST 2009
> static TypeId Class::GetTypeId()
> static TypeId tid = ....;
> return tid;
Isn't there a mechanism for optimizing exactly this situation? Return Value
Optimization (RVO) or in this case, Named Return Value Optimization (NRVO)?
Hasn't this been in gcc since release 3.something? Doesn't this
optimization already elide the "extra" copy construction that we're
discussing removing? I'm not following this thread in great detail, but
isn't this particular case a solved problem?
We've had past discussions regarding addressing performance in situations
with pass-by-value semantics by using pass by const references. But that
doesn't seem to have much to do with the case above.
I must admit I'm getting a little confused about what exactly is being
suggested and measured ...
More information about the Ns-developers