Relative Content

Tag Archive for pythonnumpyloopsrecursionnumba

Speeding up recursive function with Numba

I have some code that uses a lot of nested loops to perform some computation, and wanted to rewrite this code to use recursion for two reasons: 1) readability and 2) generalized functionality. The second reason is the most important as nested loops limit the use of this program to inputs that have a very specific length (7 in my case). However, I’m finding that the recursive implementation is slower than the iterative approach and would like to find potential solutions for this.