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

use go-ipld-prime scratch.Reader #1

Closed
wants to merge 1 commit into from
Closed

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Dec 9, 2020

for @warpfork

This doesn't work. Maybe to do with the complex logic required for Readn1() and Unreadn1()?

All tests fail with this change, not all with the same reason either. Some are unexpected EOF and some seem to be seeing the same data repeated (duplicate Name section).

@mvdan
Copy link
Contributor

mvdan commented Jan 10, 2021

Did this fly under our radar? Just found it by searching for forgotten Go PRs :)

@rvagg
Copy link
Member Author

rvagg commented Jan 10, 2021

I've put it aside for revisiting, I can't make the new reader work, I'd like to so I can get rid of the refmt dependency, but it seems there's either API differences or a bug and the time investment just now isn't worth it, for me at least. You're welcome to look into it though! I'm sure you could power through solving this one with your Go eyes.

@mvdan
Copy link
Contributor

mvdan commented Mar 28, 2021

#21 is my take on this; it parses a []byte instead. See the PR for more details.

I'm not saying "no" to something like scratch.Reader forever, and I'm happy for someone else to take a stab at it in the future while benchmarking. But I do think that there's an inherent overhead in such reader wrappers that we can't afford if we want to make this codec usable in dagpb without a significant slow-down.

@rvagg
Copy link
Member Author

rvagg commented Mar 29, 2021

👍 if we're optimizing for smaller block sizes then scrapping streaming parsing is the way to go and fine by me

@rvagg rvagg closed this Mar 29, 2021
@mvdan
Copy link
Contributor

mvdan commented Mar 29, 2021

usable in dagpb

I meant usable in go-merkledag, of course :) Its block sizes do tend to be small, and it uses buffers anyway.

@mvdan mvdan deleted the rvagg/scratchreader branch April 20, 2021 10:23
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

Successfully merging this pull request may close these issues.

2 participants