Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Create basic implementation for _addOperationBatch #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ptoner
Copy link

@ptoner ptoner commented Apr 28, 2019

I was trying to use the "batchPut" function in orbit-db-docstore but noticed that this method wasn't implemented yet.

Rebuilding the index seemed like it was probably the most expensive part, so I saved it for the last operation. I wasn't sure if there were any other intended optimizations. I wasn't sure what to do the with "batchOperation" variable that is passed in. I'm also not sure if "_localHeads" should be set every iteration or just the last one.

@aphelionz
Copy link
Contributor

Hey @ptoner, if you're still interested in getting this in I'd love to help. It would be great to have tests, might you be able to write them?

@ptoner
Copy link
Author

ptoner commented May 14, 2020

Yea I'm still into it. It's been so long that I forgot that I actually included code, ha. What kinds of tests would we need? I still don't know the answers to my original questions.

@aphelionz
Copy link
Contributor

I see - @haadcode looks like Git blames you 😆 77490af

What did you have in mind for these arguments or this function in general? See @ptoner 's ruminations in the OP

@haadcode
Copy link
Member

It was a long time ago and afaik we don't use _addBatchOperation() anywhere. More generally, as this was never implemented, feel free to implement it the best possible way, including the signature of the function.

That is to say, I don't know (can't remember) what the batchOperation variable is :)

On high level it makes sense that we would set _localHeads as the very last thing, only once.

Does that answer your questions?

@ptoner
Copy link
Author

ptoner commented Jun 1, 2020

Yes that does help. I'll try to put together some tests for this soon. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants