Re: [Tutor] Continuously slower program
by SA other posts by this author
Jun 12 2002 2:03PM messages near this date
Re: [Tutor] Continuously slower program
|
[Tutor] Re: Continuously slower program
On 6/11/02 6:57 PM, "Seiji Funai" <seiji_funai@[...].com> wrote:
> This is a test for the beginning of a meter that I'm
> writing for a GUI. The application slows
> continuously. Does my computer just suck, or is there
> something I can do? Please let me know.
>
> Thanks!
>
I'm no expert on Tkinter, so I'll only give you the results from my running
of the program:
I ran this in Xdarwin on an Apple G4 Powerbook w/ 512 M of RAM running OSX.
I ran the script alongside top to gauge cpu usage. CPU usage by the user
(me), because top spits usage down amongst system and user, during the
running of this script jumped from roughly 30% to a rough average of 75%
with 85% being the maximum amount I saw.
So I would have to concur that it is NOT your sytem that is causing the
problem. Something in the app is draining CPU cycles.
If I had to guess, and I definitely could be wrong, I would say your problem
may lie in this section:
def start(self):
self.testMeterCanvas.create_arc(self.box, start = 0, extent = 180, fill
= "white")
while 1:
self.count = self.count + .1
if self.count == 1000:
self.count = 0
self.testMeterCanvas.create_arc(self.box, start = 0, extent = 180,
fill = "white")
self.x = 25 * math.sin(self.count) + 33
self.y = -25 * math.fabs(math.cos(self.count)) + 33
self.testMeterCanvas.create_line(33, 33, self.x, self.y, fill = "red")
root.update()
Good Luck.
SA
_______________________________________________
Tutor maillist - Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Seiji Funai
Michael P. Reilly
Gregor Lingl
SA
Michael P. Reilly
SA
Jeff Shannon
SA
Derrick 'dman' Hudson
|