> If I remember correctly, instances of all single byte ints (0 <= x < > 256) are created automatically, so iterating over a bytearray may > avoid new object creation.
That would certainly make sense. I wouldn't be too surprised if it pre-allocated/interned single-byte chars as well. > Yeah, everything is a heap allocated PyObject in CPython. Check out > Cython for writing Python that compiles to C and can use raw C types > (bytes & chars) without much effort. Depending on your use case and > dependencies, PyPy might be worth checking out. Doing lots of > iterations over homogeneous data types is where JITs shine. Thanks for the pointers, Michael! _______________________________________________ Portland mailing list [email protected] http://mail.python.org/mailman/listinfo/portland
