[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] optimising render code
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] optimising render code
- From: andrew baker <failrate@xxxxxxxxx>
- Date: Sun, 18 Sep 2005 00:13:52 -0700
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sun, 18 Sep 2005 03:14:07 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=aBbYb5P8BIQ4jbRQpw9wjRgWxS/bzwxBNty/lWisb0hyesJW9tr1A4sqxJsu8mKgGsoS5fwT5OSgCi2Zh9skV3NgYpYIbH5y/SmbaJUjIkE3V++0GMjbT4Ly31jMwhR5zHGl0AOKiGxNwpbL8MSj1mNKRK3IH5pUr0bmLZuyhuc=
- In-reply-to: <432BFAB1.4080604@gmail.com>
- References: <432BFAB1.4080604@gmail.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I'm having a kind of hard time figuring out what's going on here.
I'm guessing that x in range() is just to run the function a number of
times in order to calculate relative time? If so, you might want
to output the time.strftime() with whatever time format you prefer
before and after the execution of the function code, to better time it.
Also, in test1(), you're throwing away z.
Finally, what's dol()? Obviously, since it's a different function than enumerate(), it might have a different overhead.
One last read you'll probably find interesting:
Python Patterns - An Optimization Anecdote
--
Andrew Ulysses Baker
"failrate"