Frederic Bouvier writes:
> Ok, I got it ! You are passing list to interpolate by value, so there is
> a huge ( in my case ) penalty copying and destroying list that is pretty
> big for the short term samples. The patch below cures the problem and
> saves some precious milliseconds.
>
> -Fred
>
> D:\FlightGear\cvs\FlightGear\src\Replay>cvs -z3 -q diff -u
> Index: replay.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Replay/replay.cxx,v
> retrieving revision 1.8
> diff -u -r1.8 replay.cxx
> --- replay.cxx 23 Jul 2003 13:48:19 -0000 1.8
> +++ replay.cxx 23 Jul 2003 16:59:37 -0000
> @@ -372,7 +372,7 @@
> /**
> * interpolate a specific time from a specific list
> */
> -static void interpolate( double time, replay_list_type list ) {
> +static void interpolate( double time, const replay_list_type &list ) {
> // sanity checking
> if ( list.size() == 0 ) {
> // handle empty list
Doh! Good catch. :-) Believe me, I didn't intentionally want to pass
a *copy* of that much data around.
Thanks,
Curt.
--
Curtis Olson IVLab / HumanFIRST Program FlightGear Project
Twin Cities curt 'at' me.umn.edu curt 'at' flightgear.org
Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel