Are there any useful resources to compare the performance of python and c++ languages in algorithms dedicated to solving discrete optimization problems?
If you are using a solver (open-source or commercial) to solve a discrete optimization problem, and if the problem is not trivial or extremely easy, chances are very high that the bulk of the computation time will be spent inside the solver. The solver will almost assured be programmed in C or C++. So the Python/C++ question likely boils down to which performs better (and by how much) when constructing the model and recovering and post-processing the solution. C++ will almost certainly be faster, but whether the difference in speed matters to you will probably depend on how large the model is and how sensitive you are to the time spent setting up the model (which, on a difficult model, will probably be a very small fraction of the total solution time).
However you measure it, you'll find that the C++ is faster, but almost certainly by a linear, or sub-linear, factor.
So if something takes two or three times as long to solve, does it really matter?
Especially when CPUs continue to be faster and cheaper each year.
I'd be more concerned about the efficiency of the algorithm itself, where cutting something down from n³ to n² will more than make up for any inefficiencies of the specific language.
Well-written, simple, and obvious code:
- Provides confidence that it is correct.
- Greatly reduces the human time required for coding, debugging, maintenance, and future modification.