Skip to content

Performance bottleneck #2

@ojdo

Description

@ojdo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions