[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Does anyone have a python implementation of A*?



Well, I know for a fact that map uses C loops, I really don't use list 
comprehensions much..

2.27025711536
0.70191192627

Thats with a G4 though.. but my dual p3-500 in linux gets:
2.4457000494
0.399648070335

-----
import time

SIZE = 1000000

t0 = time.time()
l = [0]*SIZE
for i in xrange(SIZE): l[i] = i
t1 = time.time()

print t1-t0

t0 = time.time()
l = map(None,xrange(SIZE))
t1 = time.time()

print t1-t0
------


On Saturday, February 16, 2002, at 05:42 PM, Magnus Lie Hetland wrote:

> Magnus Lie Hetland <magnus@hetland.org>:
>>
>> l = [i for i in range(SIZE)]
>>
>
> That should of course have been
>
>   l = [i for i in xrange(SIZE)]
>
> Doesn't change the picture much, though. The plain for loop is still
> faster.
>
> --
> Magnus Lie Hetland                                  The Anygui Project
> http://hetland.org                                  http://anygui.org
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org