[ENH] Faster Damage Recorder (was: RE: [BUG]Picking up morphs withthe hand.)

Daniel Vainsencher danielv at netvision.net.il
Thu Aug 7 23:43:37 UTC 2003


[DamageRecorder strategy]
A while ago I wrote the attached damage recorder that is more wary about
merges - assuming the magical constant is right (I guessed them), it
should only merge when that would actually be profitable.

To see the difference, first turn on damage debugging, create a
screen-sized bouncing atoms morph, remove the optimization in
BouncingAtomsMorph>>invalidRect:from: that causes it to always update
everything, bring up an FPS morph, and then load the attached code.

It's pretty nice to compare what happens with halos and other such.

BTW, I haven't tried out your conservative merge code as opposed to the
regular damage recorder (just hosed an image try to write stuff to the
Transcript - doh), but since using the above dr didn't seem to help, I'm
assuming the dr is not making any big mistakes, at least for the
specific measurement I did.

Daniel

Andreas Raab <andreas.raab at gmx.de> wrote:
> Hi Daniel,
> 
> > Any idea why the damage recorder isn't being used? that does some
> > merging.
> 
> DamageRecorder could be used here but its strategy is somewhat questionable
> for the particular case in question. DamageRecorder needs to assume that we
> may have lots and lots of tiny rectangles coming along and will aggressively
> merge stuff even at the expense of larger overall areas to redraw. That's a
> reasonable strategy for arbitrary morphs but in the case of the hand we know
> that the hand is going to redraw pretty much everything, e.g., a few large
> instead of lots of small areas. If, for any reason, we have computed a
> relatively large list of damage for the world, we may forceToScreen even
> larger portions when you try to merge the hand damage. For this situation,
> the code I posted is more adequate as it will not introduce larger areas and
> be accurate (at the assumption that hands generate few damage areas which is
> generally true).
> 
> > gives me back 20%, on 
> > 
> > TimeProfileBrowser onBlock: [5 timesRepeat: [ActiveHand grabMorph: s .
> > World doOneCycle. ActiveHand dropMorphs. World doOneCycle.]] 
> > 
> > 20% isn't much, though. 
> 
> 20% is quite a bit more than I would have expected ;-) See my other post.
> 
> Cheers,
>   - Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AlternativeDamageRecord.cs
Type: application/octet-stream
Size: 3461 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030808/53f44483/AlternativeDamageRecord.obj


More information about the Squeak-dev mailing list