Jon Berndt writes:
 > > I had been concerned
 > > that SGPropertyNode::getDoubleValue was showing up at the top of the
 > > profiling output for JSBSim, but I think that that was masking the
 > > object methods it was invoking in other JSBSim code.
 > 
 > Could very well be.
 > 
 > > properties, but not much for anything else.  The biggest surprise was
 > > that inlining methods made things slower, not faster, in most cases
 > 
 > This is certainly interesting. Do you have any statistics on how the
 > property code was changed by un-inlining things?

I'm afraid that my tests were fast and not that scientific, but here's
the most dramatic case, for 100,000,000 accesses of a double property:

  Everything inlined: 3.9sec
  Nothing inlined: 3.2sec
  Only variable-reference getters inlined: 3.15sec

In this test, we paid a 22% time penalty for inlining even 2-3 line
methods (anything that didn't resolve simply to a variable reference).
Perhaps the results would be different under other circumstances.  By
"variable-reference getters" I mean things like

  double get_foo () const { return _foo; }

where the compiler will treat

  double foo = thing.get_foo();

as

  double foo = _foo;


All the best,


David

-- 
David Megginson
[EMAIL PROTECTED]


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to