On my 11th gen Intel laptop, this library is 3x faster than the default
one (and is the one we use in go-multihash).
See below (GEN_ is the builtin version, SHA_ is this library).
BenchmarkHash/SHA_/8Bytes-8 94.31 ns/op 84.82 MB/s
BenchmarkHash/SHA_/1K-8 926.9 ns/op 1104.74 MB/s
BenchmarkHash/SHA_/8K-8 6793 ns/op 1205.98 MB/s
BenchmarkHash/SHA_/1M-8 883694 ns/op 1186.58 MB/s
BenchmarkHash/SHA_/5M-8 4347298 ns/op 1206.01 MB/s
BenchmarkHash/SHA_/10M-8 8810864 ns/op 1190.09 MB/s
BenchmarkHash/GEN_/8Bytes-8 283.2 ns/op 28.25 MB/s
BenchmarkHash/GEN_/1K-8 3587 ns/op 285.48 MB/s
BenchmarkHash/GEN_/8K-8 27706 ns/op 295.68 MB/s
BenchmarkHash/GEN_/1M-8 3414827 ns/op 307.07 MB/s
BenchmarkHash/GEN_/5M-8 16789216 ns/op 312.28 MB/s
BenchmarkHash/GEN_/10M-8 34073478 ns/op 307.74 MB/s
We now use the go dev's version, which is faster. Unfortunately, minio's
sha256 implementation is still significantly faster than the built-in
version, so we can't drop that yet.
part of #1646
* Update core dep
* Downgrade grpc issue due to: https://github.com/weaveworks/common/issues/239
* Use released versions for resource-manager and go-libp2p-core
* Use released version of go-libp2p-testing
* fix: return the best _acceptable_ conn in NewStream
Otherwise, we can return, e.g., a transient connection that can't
actually be used.
* fix: fail dial if we can't have a usable connection
If we have a transient connection, don't want to use a transient
connection, and haven't specified "force direct dial", fail the dial.
The previous location would prevent explicit calls to `Connect`, but not
implicit connections on `NewStream`. Given that the host calls `Connect`
before calling `NewStream`, it's unclear whether or not this would
likely be triggered by user code, but we still need to fix it.
Expose a function to create a MuxedConn from the base type: if a user has
a *mp.Multiplex or a *yamux.Session, they should be able to construct the libp2p
wrapper without going through the Transport interfaces.
Signed-off-by: Christian Stewart <christian@paral.in>
* Fix flaky timing dependent tests
* Update go-libp2p-peerstore dependency
* Register notifiee synchronously
* Only a single connection
* Remove WaitForDisconnectNotification hack since notifs are now synchronous
* Add debug logging to identify tests
* Close chan once