Skip to content
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

Cache the cid #6

Closed
Stebalien opened this issue Jul 3, 2017 · 4 comments
Closed

Cache the cid #6

Stebalien opened this issue Jul 3, 2017 · 4 comments

Comments

@Stebalien
Copy link
Member

go-ipfs and friends make no attempt to cache Node CIDs and will call Cid() repeatedly as-needed. Therefore, calling Cid() 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.

@ghost
Copy link

ghost commented Jul 3, 2017

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.

You can have different CID implementations for different performance use cases, just in case it does tie up too much memory

@Stebalien
Copy link
Member Author

Cache CID

  • Blob

Cache RawData

  • Commit
  • Tag
  • RawData

@Stebalien
Copy link
Member Author

You can have different CID implementations for different performance use cases, just in case it does tie up too much memory

Different CID implementations? A node's CID should never change (and CIDs are concrete types...).

@ghost
Copy link

ghost commented Jul 3, 2017

and CIDs are concrete types...

Ah right

@whyrusleeping whyrusleeping added the status/deferred Conscious decision to pause or backlog label Oct 17, 2017
sameer added a commit to sameer/go-ipld-git that referenced this issue Dec 18, 2018
sameer added a commit to sameer/go-ipld-git that referenced this issue Dec 18, 2018
sameer added a commit to sameer/go-ipld-git that referenced this issue Dec 18, 2018
magik6k added a commit that referenced this issue Dec 30, 2018
Cache RawData for Commit, Tag, & Tree, fixes #6
@ghost ghost removed the status/deferred Conscious decision to pause or backlog label Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants