Speed of data structures in python

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sat Mar 11 03:12:30 CET 2006

On Fri, 10 Mar 2006 23:24:46 +1100, Dave wrote:

> Hi. I am learning PyOpenGL and I am working with a largish fixed scene  
> composed of several thousand GLtriangles. I plan to store the coords and  
> normals in a NumPy array.
> Is this the fastest solution in python? would i be significantly better  
> off (timewise or otherwise) using some other data structure to hold this  
> information? no other data structure appears as convenient, but am i  
> loosing valuable time?
> I am new to 3d programming so please feel free to state the obvious,  
> thanks.

Optimization without measurement is at best a waste of time and at worst
counter-productive. Why don't you time your code and see if it is fast

See the timeit module, and the profiler.


More information about the Python-list mailing list