# Is solving a quadratic programming optimization problem using python slower than C++？

I am using the cvxpy library in python to solve a quadratic programming problem and the solver used is scip. I found that when the amount of data becomes large, the solution process will be particularly slow. Therefore, I am thinking about whether C++ can speed up the solution, such as some numerical calculation libraries in C++,alglib,nplot and so on.

But I'm really not sure whether C++ will be faster. Because most of the time is consumed in the solving process, rather than the speed of code execution, I think the solvers used are similar, such as SCIP, OSQP and so on.

If I want to switch to C++ to implement, then I should need a lot of time to learn those libraries, but I am not sure whether they are really useful, because I am afraid that I have done useless work, so I raised this question and wanted to know their speed is there really a big difference.

• This is a comment as it may only add to other more complete answers. The python library cython allows writing python syntax (with some extras) to create c or c++ complied python extensions. Speedup over python is incremental and up to you how deep you want to go in learning cython. Depending on the optimization library you are using and the nature of your python code, the speedup could be significant. If you have for loops over arrays, cython is sure to give big improvements. Dec 5, 2022 at 0:24

• I see, I mean just for the solving process time, prob.solve(solver='SCIP') , should they be the same? Because actually in my case, the pre-processing or data manipulation time is little. Almost all the time is consumed in the solving process. Dec 4, 2022 at 12:54
• I see, vectorizing the problem can be faster, sum all the cost and constrains can be slower. But what if my problem can't be vectorized modeled. So I have to sum all and then solve. Dec 5, 2022 at 1:20