|
optimising render code: msg#00156python.pygame
hi i am trying to find the fastest way to render objects in a stack. After some tests i found that given a unidimensional array with 1000 numbers the following functions behave the oposite i would expect def test1(): for x in range(10000): for z, n in enumerate(stack): y = n*999 # some calculation def test2(): for x in range(10000): z = 0 # opengl Z render position for n in dol(stack): z+=1 # from botton to top y = n*999 # some calculation Basically the 2nd seems to perform far faster than the first, unless i am doing something wrong. I have been checking out some articles about optimising performance in python etc... But i am a bit confused so far. I was wondering if there is some good but clear game where i could check techniques to improve this. thanks! -- altern |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Double Buffered display vs Overlays: 00156, Michael Sparks |
|---|---|
| Next by Date: | Re: Double Buffered display vs Overlays: 00156, Michael Sparks |
| Previous by Thread: | SPEi: 00156, Jason |
| Next by Thread: | Re: optimising render code: 00156, andrew baker |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |