Questions relative to Mojo's optimization and speed
Hello, I have a project in Python that requires doing a lot of processing on datas and I'm noticing it taking a lot of time. So I'm planning to use Mojo instead of Python.
1. I know that Mojo is way faster than Python in most cases but I'm wondering if it's still the case if I use python libraries like pandas or scikit-learn like so:
How can Mojo run these libraries functions without the python interpreter being slow ?
2. Also, if I'm writing this command << %%python >> in a jupyter notebook cell with the Mojo kernel activated, will the code below be executed by the python interpreter or by the Mojo compiler?
2 Replies
importing a python module like pandas will cause any functions/methods you call from that module to run inside the python interpreter and will not get any speed boost from mojo. Same goes for the python cells in mojo notebooks
You might want to give polars a try if your slow processing is related to pandas code. Polars is around 10x faster but the exact speedup depends on the use case
thanks for your answer, i'll consider give polar a try 🙂