-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat!: use generics instead of cbg.Deferred #122
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvagg
added a commit
to filecoin-project/go-state-types
that referenced
this pull request
Aug 3, 2024
rvagg
added a commit
to filecoin-project/go-state-types
that referenced
this pull request
Aug 3, 2024
Experimentation with this going on over at filecoin-project/go-state-types#298 against a >3M entry HAMT. |
Rebased on #121, which has the restored cbor-gen code in it, so this now depends on whyrusleeping/cbor-gen#103 for cbor-gen generics support. |
Bailing on this for now, as per whyrusleeping/cbor-gen#103 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimenting with generics to do away with the deferred value decoding step.
The generic must conform to
[T HamtValue[T]]
where:*
pointers are kind of awkward in this, tho I'm not sure I can do much better without heavier changes (e.g. there's situations where you want to passnil
to indicate deletion)Equal
is a little annoying, but necessary to know whether we're mutating in certain situationsFindRaw
is gone, doesn't make sense anymore I think.Find
has a current use-case where you passnil
as the decoder and that means "I just want to know if it's there"; for certain typesT
it'll be more expensive to decode the full node withT
elements than it was to do thecbg.Deferred
cbor token skip job. Maybe./v4
but we still retain the/v3
variant for some cases.