-
Notifications
You must be signed in to change notification settings - Fork 19
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 RawData for Commit, Tag, & Tree, fixes #6 #28
Conversation
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.
Do you mind writing a quick benchmark to compare this vs master?
Sure, should that be done as a |
Whatever works best for you and you think should show a difference is fine. |
So I tried to run it against the go-ipfs repo and interestingly it crashes the ipfs daemon with Instead I ran it against just ipfs/ipfs and got the following:
Before (rm -rf'ed .git/ipld):
I can run it a few more times just to make sure. |
Ok, I had a chance to do more comprehensive testing. All the files in the repo are already added to my ipfs daemon, so they should return fast. The bench script just does
After:
There doesn't really seem to be any difference when I did this test. Is there some better way to do one? |
Most of this will be I/O. I'd use |
Ok, I've written a
Before:
|
Are there any other changes I should make for this PR? |
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.
Looks good, thanks!
A
rawdata []byte
member is added to each type. It is computed on the first call toRawData()
.Also noticed a few odd indentations and fixed them.
Let me know if there are any changes that need to be made, feedback is welcome.