-
Notifications
You must be signed in to change notification settings - Fork 146
feat: cacheless amt iteration #2189
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2189 +/- ##
==========================================
+ Coverage 77.50% 77.56% +0.06%
==========================================
Files 147 147
Lines 15743 15789 +46
==========================================
+ Hits 12201 12247 +46
Misses 3542 3542
🚀 New features to boost your workflow:
|
CI blocked by #2187 |
The only concern I have here is that this reportedly reads twice as many blocks as the cached version which seems off to me. I'd like to figure out what's going on there first. |
Three iterations in the tests lead to this block read count.
ref-fvm/ipld/amt/tests/amt_tests.rs Lines 434 to 445 in bf6fc44
ref-fvm/ipld/amt/tests/amt_tests.rs Line 448 in bf6fc44
Now, given that the only block read operation (and cache read) occurs here, it makes sense. Lines 451 to 457 in bf6fc44
All entries are "normally" cached on the 1st pass, but in the Lines 230 to 236 in bf6fc44
|
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.
needs docs, but lgtm
can be rebased on master because the other PR is merged now
bf6fc44
to
d782519
Compare
1ced61e
to
9b21dbd
Compare
ipld/amt/src/lib.rs
Outdated
//! | ||
//! Data structure reference: | ||
//! https://github.com/ipld/specs/blob/51fab05b4fe4930d3d851d50cc1e5f1a02092deb/data-structures/vector.md | ||
//! <https://github.com/ipld/specs/blob/51fab05b4fe4930d3d851d50cc1e5f1a02092deb/data-structures/vector.md> |
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.
warning: this URL is not a hyperlink
--> ipld/amt/src/lib.rs:8:5
|
8 | //! https://github.com/ipld/specs/blob/51fab05b4fe4930d3d851d50cc1e5f1a02092deb/data-structures/vector.md
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
= note: `#[warn(rustdoc::bare_urls)]` on by default
help: use an automatic link instead
|
8 | //! <https://github.com/ipld/specs/blob/51fab05b4fe4930d3d851d50cc1e5f1a02092deb/data-structures/vector.md>
| + +
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.
There are other doc links issues in the repo; I'll have a look later and see if there can be a friendly CI check to ensure this doesn't happen in the future.
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.
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.
nice
I bet the HAMT could get exactlty the same treatment
This exposes an alternative iteration method without caching. Without it, the memory usage for iterating over deal proposals is too high (my 64 GiB machine gets knocked out under a minute). For reference, this works fine in Go's AMT implementation.
With
for_each_cacheless
, I can iterate the proposals in ~90s (no-op iteration).The logic is mostly taken from the
for_each_while_mut
.