I have some python code, and I'm wondering what I can do to optimize the speed for creating the array using Cython. Note that I have tried other methods: Counting Algorithm Performance Optimization in Pypy vs Python (Numpy vs List)
It seems like Cython is significantly faster than anything I've tried before right out of the box. I am wondering if I can get even more performance.
#!/usr/bin/env python
def create_array(size=4):
"""
Creates a multi-dimensional array from size
"""
array = [(x, y, z)
for x in xrange(size)
for y in xrange(size)
for z in xrange(size)]
return array
Thanks in advance!