sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
6 stars 5 forks source link

test_simulation.py runs very slowly #204

Closed sbenthall closed 1 year ago

sbenthall commented 1 year ago

The automated tests in test_simulation.py hang for an unusually long amount of time. Would be good to trim this down somehow.

alanlujan91 commented 1 year ago

This might have to do with the deepcopying of agents when explode_agents gets called. One way to reduce this time would be to reduce num_by_type parameter, to maybe 2 just for simple testing of the feature.

sbenthall commented 1 year ago

You might be right. But I am surprised that deepcopying takes so long. Have you timed it? I know you mentioned it. If that is the bottleneck, there may be more efficient ways to create multiple identical agents (like, building them all with the AgentType constructor).

Yes, reducing num_by_type for the test would make sense. But

sbenthall commented 1 year ago

I think we identified that the problem was #205