-
Notifications
You must be signed in to change notification settings - Fork 119
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
Improve speed of random_agent #897
Conversation
I have to say that this means that probably there is something to improve in Base, since that the previous method is so slow sounds strange |
Codecov Report
@@ Coverage Diff @@
## main #897 +/- ##
===========================================
+ Coverage 80.27% 92.37% +12.09%
===========================================
Files 44 32 -12
Lines 3027 2334 -693
===========================================
- Hits 2430 2156 -274
+ Misses 597 178 -419
... and 18 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Actually it was a O(N) operation while this one is not, this means that the improvement in speed is arbitrary large! |
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.
I don't think it is a bug in base. It is probably an inferrence issue since the agent container is complicated. The function barrier makes the inference work.
DOn't forge tto add changelog entry and then merge!
I think it should be JuliaLang/julia#51605 , let's see :-) |
It was actually very slow before, consider this silly model I was using to benchmark a different thing:
before:
after:
A micro-benchmark tells that now random_agent for a StandardABM is 40x faster!
I exported a new function
random_id
in the process, which is in line to the other random functions which export also the id version