25 ms·
I experimented with OCaml and some of my Python code. I found that using Python with Numba enabled me to get much better performance than the same algorithm wri
by garyrob 5y ago
I experimented with OCaml and some of my Python code. I found that using Python with Numba enabled me to get much better performance than the same algorithm written in OCaml.
In this case, using Numba for the performance-critical aspect was trivially simple, just the addition of a decorator. And I've found that is generally pretty close to true, at least for the kinds of things where I care about performance.
That's why I'm still in the Python world rather than the OCaml world for my algorithmic work. I really like OCaml as a language and would actually prefer to use it, but Python/Numba seems to give me substantially better performance, as well as all of Python's standard libraries.
And Numba lets you turn off the GIL, so you can get multiple cores going at once.
YMMV, of course. I'm not making a general claim that would be true for everyone. But I think it may be worth mentioning that it could be true for more uses than one might assume.