xrange v. range

Linkman226

#anarchy
Joined
Sep 14, 2007
Messages
2,493
In python, I'm aware that xrange is quicker than range, but is it worth it to change all the range's in my mod to xrange's? That is to say, how much of a net benefit speed-wise is there?
 
none, unless you loop over a list of thousands, millions...

for small lists like those found in Civ4, range() can be supposedly faster (you'd probably have to loop it a million times to see any difference)
 
Back
Top Bottom