[plt-scheme] frtime slowing down

From: Dave Griffiths (dave at pawfal.org)
Date: Mon Mar 24 04:08:45 EDT 2008

On Sun, 2008-03-23 at 11:46 -0400, Gregory Cooper wrote:
> I'm not sure I know what you mean by "leave circles hanging around".
> 'Integral' is based on real time, so if there's a long GC pause,
> objects will seem to stop for a moment, then suddenly skip away.
> There should still never be more than five circles on the screen at a
> time; it's just that some of them may manage to travel farther than
> they would if there hadn't been a GC.  To avoid this, you can use a
> different version of 'integral', defined something like this:
> 
> (define (my-integral v)
>   (collect-b (changes milliseconds) 0 (lambda (_ s) (+ s (value-now v)))))
> 
> Note that this will also change more slowly than the built-in
> 'integral', since 'milliseconds' doesn't actually change every
> millisecond (it's set to 20ms by default).  So to approximate the old
> behavior (without the skips), you could say (* 20 (value-now v))
> instead of (value-now v).
> 
> Unfortunately, if you use this definition instead of the built-in
> 'integral', then I think you'll need to put that (collect-garbage)
> call back in, or it will leak behaviors and eventually choke.  

Yes, as you predict, this is much better, and removes the artifacts -
but still occasional hiccups when doing the garbage collection.

> I have
> a better fix in the works, which should plug the leak without the need
> for an explicit GC there, and that should help to reduce the long GC
> pauses.  I should be able to check that into trunk later today, and I
> can send you a patch for 372 if necessary.

I've got the svn version, but I'm having difficulty getting everything
working in parallel with 372 (which I need to keep around for running
stable versions of fluxus for performances). Patches to 372 would be
most appreciated for the meantime, if it's not too much hassle.

Thanks for looking into this for me!

cheers,

dave



Posted on the users mailing list.