frustrations in de-slowifying code.
Ned Konz
ned at squeakland.org
Sat Mar 20 23:41:20 UTC 2004
On Saturday 20 March 2004 9:37 am, Alan Grimes wrote:
> 70% of my time was being spent in " BitBlt class >> bitPeekerFormFrom: "
>
> Most of this time, (67% of the 70%) was spent in a constructor method
> of Form, " extent: depth:"
>
> If this creation of an auxilary form could be discarded, then it would
> also be of great benefit to these other methods:
>
> B3DScanner > textureColor: aTexture atS: sValue atT: tValue
> ColorForm > pixelValueAt: aPoint
> Form > floodFill2: aColor at: interiorPoint
> Form > pixelValueAt: aPoint <<< this is the one I'm using,
> indirectly through
>
> "colorAt: "
> Pen > print: str withFont: font
> StarSqueakMorph > createPatchFormGetterAndSetter
> WarpBlt > warpBitsSmoothing: n sourceMap: sourceMap
Well, none of those methods are meant to be used in tight/fast loops.
If you want to analyze forms repeatedly, then make your own bitPeeker and keep
it around.
Or use other methods (for instance, use BitBlt to XOR with a desired color and
then look for 0 pixels).
For instance, look at the implementation of
Form>>floodFill2:at:
--
Ned Konz
http://bike-nomad.com/squeak/
More information about the Squeak-dev
mailing list
|