The current Cython implementation for Cython (i.e. rand() and randn()) jumps through some hoops to call numpy's random functions via Python, buffering it in a numpy array. Since numpy 1.8, numpy.random has a dedicated Cython/C API, so we might be able to replace this with an easier and more efficient solution.
https://numpy.org/doc/stable/reference/random/c-api.html
This is mostly a note for my future self, I have not yet looked into this in detail.
The current Cython implementation for Cython (i.e.
rand()andrandn()) jumps through some hoops to call numpy's random functions via Python, buffering it in a numpy array. Since numpy 1.8,numpy.randomhas a dedicated Cython/C API, so we might be able to replace this with an easier and more efficient solution.https://numpy.org/doc/stable/reference/random/c-api.html
This is mostly a note for my future self, I have not yet looked into this in detail.