3 ms·
If you're trying to rescue existing code with type annotations, Numba can be a good solution. I think Cython has a better build story for shipping libraries tho
by syllogism 9y ago
If you're trying to rescue existing code with type annotations, Numba can be a good solution. I think Cython has a better build story for shipping libraries though. I think users need Numba if you use it -- that's not true with Cython.
If you're writing fresh code, I think Cython is much better. Numba doesn't really give you a language to work in. With Cython you can basically write C or C++ --- you can declare structs, manage pointers, even have C++ classes with templates if you want. This hash table does similar work to Google's dense_hash_map, with similar performance: https://github.com/explosion/preshed/tree/master/preshed https://github.com/explosion/preshed/tree/master/preshed . I think it's hard to write something like this with Numba.