Skip to content
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

Performance bottleneck #2

Open
ojdo opened this issue Oct 23, 2019 · 0 comments
Open

Performance bottleneck #2

ojdo opened this issue Oct 23, 2019 · 0 comments

Comments

@ojdo
Copy link
Owner

ojdo commented Oct 23, 2019

flow_balance += m.data['actor'].loc[a, 'sink-source']

As I had to learn the hard way in the larger model tum-ens/urbs#140, accessing single values using pandas .loc[...] in a loop is wasteful. Instead convert each parameter to a dictionary with fast access. It won't be noticeable here, but with millions of accesses, accessing DataFrames for single parameter values should be avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant