-
Notifications
You must be signed in to change notification settings - Fork 259
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
accounts-db: unpack_archive: unpack accounts straight into their final destination #289
accounts-db: unpack_archive: unpack accounts straight into their final destination #289
Conversation
8a446e5
to
c9ae0cd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #289 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 837 837
Lines 226874 226891 +17
=======================================
+ Hits 185870 185884 +14
- Misses 41004 41007 +3 |
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.
lgtm - left a few suggestions to avoid pattern of (manual check, unwrap/index). I think the suggestions should not add additional overhead, but can be left to a follow-up PR if you prefer.
c9ae0cd
to
dc517e5
Compare
Thanks for the review! Applied both suggestions. |
Aghh, looks like clippy didn't like the match I provided and asked you to do a |
dc517e5
to
a2f4ec0
Compare
Oops, fixed |
a2f4ec0
to
9d3c754
Compare
We used to do a iterator.clone().any(...) followed by iterator.collect(). Merge the two and avoid an extra iteration and re-parsing of the path.
…l destination We used to unpack accounts into account_path/accounts/<account> then rename to account_path/<account>. We now unpack them into their final destination directly and avoid the rename syscall.
9d3c754
to
399e17f
Compare
…l destination (anza-xyz#289) * accounts-db: unpack_archive: avoid extra iteration on each path We used to do a iterator.clone().any(...) followed by iterator.collect(). Merge the two and avoid an extra iteration and re-parsing of the path. * accounts-db: unpack_archive: unpack accounts straight into their final destination We used to unpack accounts into account_path/accounts/<account> then rename to account_path/<account>. We now unpack them into their final destination directly and avoid the rename syscall.
We used to unpack accounts into account_path/accounts/ then rename to account_path/. We now unpack them into their final destination directly and avoid the rename syscall. I've added a test and verified that it behaves the same with both old and new impl.
I also removed an extra parsing/iteration over entry paths which was unnecessary.
See discord conversation for context https://discord.com/channels/428295358100013066/838890116386521088/1217386980292427786