Curtis L. Olson wrote:
> Frederic Bouvier writes:
> > Curtis L. Olson wrote:
> > > Frederic Bouvier writes:
> > > > I am using replay for the first time and I must admit I am
impressed.
> > > > I can see now how my approaches are bad ;-)
> > > >
> > > > But, in the last 30s of play, my framerate drop to less than 1fps.
> > > > I removed the debug cout that are still in the code, but its even
> > > > worse. It is on WinXP, compiled with MSVC. The other part of the
> > > > play is at normal framerate.
> > > >
> > > > Is it something others are seeing ?
> > >
> > > I'm not seeing anything like this in Linux, although the cout's should
> > > go, I'll remove those.  Is it the last 60 seconds or truely the last
> > > 30 seconds?
> >
> > It is the last 60 seconds ( confirmed with chrono ;)
>
> The replay system keeps full data for the last 60 seconds, and uses
> lower resolution beyond that.  So it appears that the low res
> interpolation is happening quickly, but for some reason the high res
> interpolation is bogging down.
>
> I use a binary search algorithm to find the appropriate place in the
> data stream.  Perhaps something is not behaving well with that under
> MSVC?  Maybe I made an assumption that only works with gcc or made a
> mistake and got lucky with gcc?  It might be worth uncommenting some
> of the couts from the binary search algorithm to see if the search is
> progressing as it should or doing something funny.

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



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

Reply via email to