[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two questions



Quoting Jerzy Karczmarczuk:
> 2. Something funny happens with the GC.
>
> [...]
>
> Does it mean that garbage-collecting of the WX objects (under Windows
> at least) is so resource consuming that the system itself suffers??
> Why?

Yes. There are finalizations for low-level resources attached to
drawing objects, such as pens. In Windows, for example, a pen% object
has an associated Windows HPEN handle.

The slowdown you saw might be due to the overhead of managing all the
finalizations, or it might be the overhead of releasing low-level
objects like HPENs. (I'd guess the latter if you were in Windows, but
it would have to be the former in X.)

Probably the pen% implementation should use a cache to avoid allocating
and finalizaing so many low-level handles. Right now, MrEd only
provides a cache that programmers can use explicitly: the-pen-list.

Matthew