-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
pretty sure i made a serious mistake in the original commit that would have made the queue per all store instances instead of queue per store instance. |
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.
Can you add tests?
I think it should be good to go aside from additional review.
i wasn't sure of a good way to test this so i never added one. |
I suggest making a simple test that runs the code as if it would be a end user, or checking to see if the results were as intended this._addOperations calls are processed sequentially. |
The queue will be on critical code path. Before adding it, merging the PR, we should understand how this effects performance. Can you run the benchmarks and provide the results for comparison? |
no queue:60s benchmark-add:
benchmark-load:
with queue:60s benchmark-add:
benchmark-load:
they were pretty back and forth |
without queue:benchmark-add ran 60s 5 times:
with queue:benchmark-add ran 60s 5 times:
avg performance difference with queue: -2.7% |
Thanks @tabcat, great to see the numbers! I'd be ok with that performance overhead. |
@haadcode do you think something like this best implemented here or left for user space? |
@tabcat sorry, maybe I'm being slow... What are the three options? |
sorry
|
I think @haadcode's comment was an approval, though not explicit. I'm ok with merging this in as well |
@tabcat Merged, congrats. Can you run the tests on |
yes they are all passing, i wish i would have thought to run them before now, my mistake. i only ran the orbit-db-store tests prior to this. |
Great! |
orbitdb/orbitdb#737
adds a queue to _addOperation()
close() awaits for the queue to empty before resolving