-
Notifications
You must be signed in to change notification settings - Fork 878
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
More efficient datacollection #575
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As discussed on the mailing list the current implementation of DataCollector.collect can be improved in terms of speed and memory usage. I spend too much time in the last couple of days to profile the function and try to come up with a better one. For model reporters performance is not an issue since they are only evaluated once per step and not for every agent. But agent reporters could be improved. Here is a comparison between no data collection, the current data collection and my proposed function:
As you can see, the speed overhead is much smaller now, especially for few (<1000) agents.
Here is the downside, tho: The performance gains are only substantial if the agent_reporters only consist of agent attributes given as string values (e.g. "x": "x"). In the case of custom functions and/or a mix, the performance (and code) will be almost the same.
However, judging by the examples, custom functions are rarely used for agent reporters, so most models can benefit from the new code.
This might also be related to #574, since (at least collecting) the attribute state now has minimal overhead.
The text was updated successfully, but these errors were encountered: