Factsheet
Numba
Numba: A High Performance Python Compiler
numba
Numba is amazing for number crunching. Makes integrating cuda easy, too. But if you work with objects it's not really useful. The rule of thumb I use is: if it compiles with the @njit decorator, it's for numba. Otherwise not.
More on reddit.comUsing Numba with Numpy vectorized equations?
A subset of numpy works in numba nopython mode (use that!). Mostly none of the axis keywords work. Pretty sure none of it works in the gpu though. Btw first Google result is http://numba.pydata.org/numba-doc/dev/reference/numpysupported.html
More on reddit.comWow. Just wow. Was doing something math-heavy, even very recursion-heavy which is why I wasn't using numpy, and it took a few minutes to get the results. I'd tried numba once before with something and saw some very minute improvements, but figured I'd try it again. I've been doing number crunching in Python for years, and never really thought it'd make a difference.
boy was I wrong. tqdm says it took 2:48 to do the pure python. 0:05 to do with numba (I suppose including compile). I am shooketh. Entirely and completely, to my core. Even if I parallelized it completely which was my first thought, at best I'd get to 21 seconds. I can't believe it. I am sure if there's any response to this it'll be an "I told you so" but really, wow.
Numba.
Edit: because the code was pretty basic, I re-wrote the math part in C. tqdm says I'm at 1 second now. It was 3 seconds ish without the compile time (recall 5 seconds with). ~247k it/s vs ~151k it/s. Still a lot easier with the python and the jit, but the C module wasn't as painless as I thought it'd be.