On Sun, 2002-03-17 at 19:05, David Megginson wrote: > I've been running some experiments on the property manager today, > retrieving different kinds of double properties in a tight loop and > timing the results (the worst case was 6.2 seconds for 100M accesses > of a property tied to object methods; the best was 4.3 seconds for > 100M accesses of a property tied to a pointer). 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.
To get the equivalent of tieing to object methods, a once-per-frame data copy is necessary. Did your testing take this into account? > > I tried a lot of different combinations to speed things up and have > managed around a 13 per cent improvement so far for internal > properties, but not much for anything else. The biggest surprise was > that inlining methods made things slower, not faster, in most cases > (there were a couple of exceptions). That may be a quirk of G++'s > code generation, but it's probably worth considering -- I had inlined > much of the infrastructure to try to speed things up, but then put it > back out of line again piece by piece. I found only a slight improvement by un-inlining several of the most called object methods in JSBSim. The profiling did show less time spent in SGPropertyNode::getDoubleValue, but more time in the un-inlined getters. In terms of total execution time, I'd say it came out about the same. A real gain might be had if I un-inlined more tied methods, I don't know at this point. > > Since inlined code is nasty for other reasons -- it bloats the > executable, makes the header files hard to read, screws up gdb, and > forces a lot of recompilation whenever the implementation changes > (since everything that includes the header has to be recompiled) -- we > might want to consider trying to avoid it. Does anyone know of any > studies or statistics available on this? > > > All the best, > > > David > > -- > David Megginson > [EMAIL PROTECTED] > > > _______________________________________________ > Flightgear-devel mailing list > [EMAIL PROTECTED] > http://mail.flightgear.org/mailman/listinfo/flightgear-devel -- Tony Peden [EMAIL PROTECTED] We all know Linux is great ... it does infinite loops in 5 seconds. -- attributed to Linus Torvalds _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel