-
Notifications
You must be signed in to change notification settings - Fork 19
Cache the cid #6
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
Comments
You can have different CID implementations for different performance use cases, just in case it does tie up too much memory |
Cache CID
Cache RawData
|
Different CID implementations? A node's CID should never change (and CIDs are concrete types...). |
Ah right |
Cache RawData for Commit, Tag, & Tree, fixes #6
go-ipfs and friends make no attempt to cache Node CIDs and will call
Cid()
repeatedly as-needed. Therefore, callingCid()
should not recompute the CID each time. Instead, it should either be cached on when first computed (preferably, when the node is first decoded).Furthermore, the raw data should be kept around if possible so that calling
RawData()
is free. I don't expect this to tie up that much memory.The text was updated successfully, but these errors were encountered: