ipfs / go-bitswap

The golang implementation of the bitswap protocol
MIT License
216 stars 112 forks source link

feat: cache the materialized wantlist #530

Closed Stebalien closed 3 years ago

Stebalien commented 3 years ago

This can become a hot-spot.

Stebalien commented 3 years ago

@dirkmc

Sorting test is https://github.com/ipfs/go-bitswap/blob/a19b05e23dbc2cfc6b67e3c0b370eb4d219af3ac/wantlist/wantlist_test.go#L206. I've added a test that should explicitly test clearing the cache on add/remove.