1

I have two iterables a,b whose sizes are changed during the while loop (via resetting it to another new created iterable that is longer / shorter).

And I need to run a while loop like this.

while len(a) < b_length:   
    ... # here a & b are modified ( & probably get longer & shorter) via randomized functions

can I speed this up via numba?

La-Li-Lu-Le-Low
  • 191
  • 2
  • 15
  • Hi, interesting, perhaps this might be of interest https://stackoverflow.com/questions/35782977/use-numba-to-speed-up-for-loop – IronMan Oct 10 '20 at 01:48
  • Hello, you might be interested in trying to run your program in PyPy which can provide a significant performance boost, aside from that without knowing what happens inside your loop it's impossible to tell if it can benefit from numba's or PyPy's JIT compiler or if the overhead will negatively affect it. – jimakr Oct 10 '20 at 02:51
  • Yes, Numba can do that. However, if you want a correct speed-up, I think `a` need to be a numpy array and `b_length` an integer. – Jérôme Richard Oct 10 '20 at 11:59

0 Answers0