Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

bug: unnecessary memcopies in rabin chunker #35

Closed
mikeal opened this issue Jul 16, 2019 · 1 comment
Closed

bug: unnecessary memcopies in rabin chunker #35

mikeal opened this issue Jul 16, 2019 · 1 comment

Comments

@mikeal
Copy link

mikeal commented Jul 16, 2019

I was looking through the rabin usage and I think I found a bug. I commented more thoroughly in the commit introducing it 542b3e4#r34327138

At least one of 2 things are a bug, depending on how getFingerprints works.

  • If getFingerprints always goes through the end of each chunk it is handed, then there’s an unnecessary copy in Buffer.concat(pending) because pending is cleared on every iteration. This would also mean that the chunking from the stream impacts the fingerprinting and we may want the option of buffering all the data to fingerprint at once.
  • If getFingerprints does not always give you fingerprints through the end of the chunk then this code is dropping tail data when it fingerprints and then sliceing the wrong data out of the bl instance it’s using to keep prior tail data.
@mikeal mikeal changed the title bug: incorrect rabin chunking of tail data bug: unnecessary memcopies in rabin chunker Jul 17, 2019
@alanshaw
Copy link
Contributor

Can be closed? Was resolved by #40 ?

@mikeal mikeal closed this as completed Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants