Python integration and performance
I am looking into the performance of the Python Integration in Mojo. I use Dict here as example but that is just random, my question is not about a `Dict but in general
The following python program measures
on my computer to fill and modify a dictionary. as follows
When I include the dict into Mojo the performance drops significantly
Now when i shift the first loop into a python program
`
and use this in Mojo as follows:
i get
which is 1,5 times faster.
What I am mainly wondering about now are the last 2 examples. If performance is crucial, is it in certain cases when we need to rely on Python Integration advisable to perform some calculations directly in Python instead of just importing the Python object to Mojo, It feels odd but here it brings speedup.
Thanks for any thoughts on that.
The following python program measures
on my computer to fill and modify a dictionary. as follows
When I include the dict into Mojo the performance drops significantly
Now when i shift the first loop into a python program
`
and use this in Mojo as follows:
i get
which is 1,5 times faster.
What I am mainly wondering about now are the last 2 examples. If performance is crucial, is it in certain cases when we need to rely on Python Integration advisable to perform some calculations directly in Python instead of just importing the Python object to Mojo, It feels odd but here it brings speedup.
Thanks for any thoughts on that.
