-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
speedup create model #140
speedup create model #140
Conversation
@tzipperle: can you roughly quantify your experienced speed-up on model creation, e.g. for the mimo-example with 8760 time steps? 5%, 50%, 95%? I always thought that Pyomo itself was the larger bottleneck in the process. Therefore, I'm very curious for your finding in this case. |
From what @tzipperle told me yesterday, 90% |
I did a short glimpse over to pandas' GitHub repo. Can you comment on the pandas version used for this observation? Seems there have been some regressions w/r/t indexing performance lately, e.g. pandas-dev/pandas#16644. If it's caused by such a regression, we might be happy by just waiting for an upstream fix. If it's actually inherent to using loc in this tight loop, then it's great you found that bottleneck. In retrospect, I should have really profiled the |
This is highly interesting! I will also run some tests with it. |
Thank you for finally making me use the Python profiler on urbs. Here's my workflow to quantify the speedup on a basic run on
Then checkout the new version (
To inspect the results, there is the handy
A nice guided tour to this interactive browser is provided by this blog post. I did:
There, Before
After
Wow, 90% was a slight understatement. Please merge immediately. This is the biggest single speedup I seem to have missed in all of urbs... for years. Thanks @tzipperle for spotting this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be correct
@tzipperle Thank you very much! |
With pleasure! |
@tzipperle The true power of the profiler is starting to be unleashed :D I found that the main fat is on the MultiIndexed DataFrames' |
access to pandas DataFrame via loc is much slower as python dictionary