-
Notifications
You must be signed in to change notification settings - Fork 521
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
✨ Faster uuid generation #2994
✨ Faster uuid generation #2994
Conversation
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.
Seems like a straightforward improvement 👍
Only possible concern would be that the library is owned by an individual instead of python, but I think the improvements are definitely worth switching.
FYI. Sonarcloud is working correctly now. I think it's just reporting stuff that already existed in the changed files. We should still fix or ignore issues if they aren't a lot of effort. The integration test fail we can ignore. It's a flaky test that seems to be flakier recently. |
not sure of the mean/variance for the integration tests, but it seems to consistently shave some time off |
Recently merged a new workflow for the integration tests. The usually take just over 40mins and the latest run was a bit faster. They can vary a few minutes depending on if other integration tests are running at the same time. This latest run did seem a bit quicker though. |
Seems like a low effort way to speed things up. If there ever is a problem with the library, seems like a find and replace across the project would really be all that was necessary to switch back so seems like pretty low risk to add in. |
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
|
Next up on the list of improvements that nobody asked for :-) faster uuid generation!
I noticed in the StorageRecord class that a new uuid4 is always generated when one isn't provided. This seemed important. So I wondered what is the fastest way to generate a uuid, and unsurprisingly, there is a python-rust binding that claims to be 10x faster than the default python uuid library.
https://github.com/aminalaee/uuid-utils
I verified the benchmarks with a timeit script, comparing that with another rust-binding library
fastuuid
:My results:
0.28 seconds vs 2.5 seconds. That's 9 StorageRecords that can now be generated in the time that it previously took for 1!
It's a drop-in replacement. If maintainers like it as well, maybe it'll make ACA-Py a lil bit faster :-)