[Vm-dev] Re: Too many full GCs in Cog/Spur ... while just drawing GUI ...

tim Rowledge tim at rowledge.org
Sat Apr 9 17:13:51 UTC 2016


> On 08-04-2016, at 11:30 PM, marcel.taeumel <Marcel.Taeumel at hpi.de> wrote:
> 
> Hmmm... What is the difference between resizing the window with the mouse
> and doing it via #extent:? Ha! It could be the shadow when the window is
> active:

Yup. It’s so easy to forget the size of bitmaps. Those of us that grew up in the days of 386 PC/68k Macs tend to think of them as big things to be carefully handled - unless creeping senility has… whatever. Those of you that have grown up in a world of multi-core, multi-GHz CPUs with 1/2/4Gb of ram generally don’t worry about memory size at all. Both approaches can be very wrong under the right circumstances.

Scratch used to have a glorious example of ‘being oblivious to the size of things’ for drawing a border around the scripts. It involved rendering the entire script onto a new form with transparency (which was a recursive thing with many new Forms involved) and then rendering that into black and white to make a mask, then doing something with that in all 8 directions to make a sort of splodged-out shape then … I forget. It was horribly expensive in both memory and time, so eventually  I just stopped it doing that. Which is what the ‘special handling of a single submorph that wants to do its own thing’ section of HandMorph>fullDrawOn: is there for.

There is a reasonably obvious special case for rectangular things like typical windows in that one could make smaller shadow morphs corresponding to the two edges casting shadows and then simply display them alongside the window as it moves. This would save quite a bit of memory and time.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: GSI: Garble Subsequent Instruction




More information about the Vm-dev mailing list