Ask performance tips #13
-
| Dear developers of PyOptInterface, I recently used Thank you very much. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
| Thanks for trying out our project. |
Beta Was this translation helpful? Give feedback.
-
| Thank you for your reply! Please follow the procedure below to download the benchmark script. I apologize for any inconvenience, but I want to use an example that approximates a real-world and challenging scenario. git clone -b PyOptInterface https://github.com/PREP-NexT/PREP-SHOT.git cd PREP-SHOT conda env create -f prep-shot.yml conda activate prep-shot python run.pyYou can modify the solving configuration in the solve_parameters section of Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
| I fix some performance issues in this commit. The main issue is to avoid using code like this: expr = poi.quicksum(...) lhs = x - exprUse in-place operation instead: expr = poi.quicksum(...) lhs = expr lhs -= xBecause the On my computer, the model building time decreases from 374s to 248s (with Gurobi optimizer). You can try it and share your results. |
Beta Was this translation helpful? Give feedback.
-
| @Zhanwei-Liu Would you like to test my latest commit febd996 and change your local |
Beta Was this translation helpful? Give feedback.
Thank you!
I modified my timer decorator function by using a
Pythonbuilt-in library calledtracemallocto test peak memory usage due to its convenience. Below is the code I used: