pharo-graphics / Alexandrie

FFI bindings and a 2D canvas for Pharo based on Cairo, Freetype and Harfbuzz
MIT License
5 stars 2 forks source link

AeCairoMatrix optimization: use new instead of externalNew #45

Closed tinchodias closed 10 months ago

tinchodias commented 10 months ago

Example of use:

scaleMatrix
    | aCairoMatrix |
    aCairoMatrix := AeCairoMatrix externalNew autoRelease; yourself.
    self getScaleMatrixInto: aCairoMatrix.
    ^ aCairoMatrix

I observed 10x speedup:

 134616.830 per second (AeCairoMatrix externalNew)
1137675.000 per second (AeCairoMatrix new)