Sujet : Re: Performance problems with "photo copy -to"
De : saitology9 (at) *nospam* gmail.com (saito)
Groupes : comp.lang.tclDate : 08. Nov 2024, 05:18:12
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vgk3e5$3255t$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 11/7/2024 3:43 PM, Paul Obermeier wrote:
I have a simple tiling procedure and noticed a slowdown when using large images,
i.e. when doing lots of copies.
I noticed the following behaviours (both on Windows and Linux):
1. The time for copying does not grow linearly, as expected, but gets larger the more copies are involved.
2. The copy time of Tcl/Tk 9 is nearly twice the time as when using Tcl/ Tk 8.6.15 or the combination
Tcl 8.7/Tk 9. So this performance degradation does not seem to stem from Tk9, but from Tcl9. Strange!
Can anybody confirm my measurements?
I wonder if it has something to do with memory management for images.
On Windows Tcl/Tk 8.6.12, I first got results very close to your Tcl/Tk 9.0.0 versions. I ran it again and it got worse. It was embarrassingly slow so I won't disclose it here. Let's say the numbers almost tripled, and it worsened with the size of the images.
But then it errored out with a funny message :-)
not enough free memory for image buffer
The code was not deleting the images so it was running out of memory.
So I changed your code slightly and got these results:
% image delete [Tile $srcImg 10 10]
Time for 100 copies: 1.24 seconds ( 12 milliseconds / copy)
% image delete [Tile $srcImg 20 20]
Time for 400 copies: 19.01 seconds ( 47 milliseconds / copy)
...