Turns out that `pool.Put(buf)` had to *allocate* because we needed to turn
`[]byte` into `interface{}`. Apparently, we've never done this correctly we just
never noticed because we never really used buffer pools extensively.
However, since migrating yamux to a buffer-pool backed buffer, this started
showing up in allocation profiles.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
* go-datastore and friends: GetSize
* badger: new release, fewer allocations
* go-mplex: send fewer packets
* go-bitswap: pack multiple blocks in a single message, fewer allocations
* go-buffer-pool: replace the buffer pool from go-msgio
* yamux: fixed data race and uses go-buffer-pool for stream read-buffers to
reduce memory and allocations.
* go-libp2p-secio: get rid of a hot-spot allocation
* go-libp2p-peerstore: reduced allocations (at the cost of some memory)
More?
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This adds --max-depth to the "refs" commands and allows limiting
the fetching of refs per depth. Other than that, it works as before.
Note that clever branch pruning is only made when the --unique flag
is passed. Otherwise, we re-explore branches to the given depth.
This means that --unique costs memory, but may save time when
the DAGs contain the same sub-DAGs in several places (specially if
they are big). On the other side, not using --unique saves
memory but may involve re-exploring large sub-DAGs.
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
* Most of our datastores barf on non []byte values.
* We have to have a bunch of "is this a []byte" checks.
* Saves some allocations.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
The progressbar should now correctly calculate the size of a directory (by
ignoring the directory sizes).
fixes#5288
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Description:
This addresses one of the listed problem files in #4414. I chose to
keep the return statement outside of the select statement on line
132 since that behavior was already there following the write to
out.
License: MIT
Signed-off-by: John Forstmeier <john.forstmeier@gmail.com>
Also:
* Update the blockstore/blockservice methods to match.
* Construct a new temporary offline dag instead of having a
GetOfflineLinkService method.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Note: This commit is technically broken. However, I need to make a bunch of
cmds changes to make this work and I'd rather not bundle both changes into a
single commit.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>