Performance of Java vs. Python
AnsweredHi!
I want to use Gurobi for my master thesis, and I am not certain if I should use it with Java or Python. I am personally more inclined towards Python as I like the language better and have more experience with it.
My co-supervisor have lots of experience with Java, which they use at his company, but without Gurobi. He is really eager for me to use it as well and cites performance and support from his company as the two main pros of Java.
How is the performance of Gurobi in Python vs Java? I know a lot of Python libraries is implemented in C, does this go for Gurobi as well? How is the ease of use and development speed of Gurobi in Python compared to Java?
I see Gurobi have some additional features in Python, and I am tempted to go for it, but it would be nice to have a better understanding of the pros and cons first.
Hope someone can help me with this.
All the best, Even
-
All Gurobi API's are just thin layers upon the C API. So in the end they all just collect the data and then pass it on to the core library that is written in C. So from a solver and solving performance point of view it does not make a difference if you are using Python or Java.
It will of course make a difference for the model building part. The model building is done in the language you choose and dependent of how good you know the language, which data structures you choose and how fast the language is the building will be faster or slower.
If you already know one language better than I would always recommend that you stay with that language because you will save lots of time when not having to learn something new. Also we have added some features to our Python API that make it a bit nicer and easier to use.
Sonja
2 -
This sounds great! Thank you for your quick reply :)
Regards, Even0
Please sign in to leave a comment.
Comments
2 comments