Also more refactoring of bitswap in general, including some perf
improvements and eventlog removal.
clean up, and buffer channels
move some things around
correctly buffer work messages
more cleanup, and improve test perf
remove unneccessary test
revert changes to bitswap message, they werent necessary
in many places, entries are assigned from one slice to another and in
different goroutines. In one place, entries were modified (in the
queue). To avoid shared mutable state, probably best to handle entries
by value.
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
it seems to make sense since, in each place, the Key and Priority
represent the same information
b/c you know the saying...
"It is better to have 100 functions operate on one data structure than
10 functions on 10 data structures."
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
A nice invariant for bitswap sessions:
Senders and receivers can trust that messages do not contain
duplicate blocks or duplicate keys. Backing the message with a
map enforces this invariant.
This comes at the cost of O(n) getters.
Move go-ipfs/bitswap package to go-ipfs/exchange/bitswap
* Delineates the difference between the generic exchange interface and
implementations (eg. BitSwap protocol)
Thus, the bitswap protocol can be refined without having to overthink
how future exchanges will work. Aspects common to BitSwap and other
exchanges can be extracted out to the exchange package in piecemeal.
Future exchange implementations can be placed in sibling packages next
to exchange/bitswap. (eg. exchange/multilateral)