diff --git a/crypto/spipe/spipe_test.go b/crypto/spipe/spipe_test.go index ab37dec27..c4e0a0b7f 100644 --- a/crypto/spipe/spipe_test.go +++ b/crypto/spipe/spipe_test.go @@ -36,9 +36,11 @@ func bindDuplexNoCopy(a, b pipes.Duplex) { } } +var globuf = make([]byte, 4*1024*1024) + func bindDuplexWithCopy(a, b pipes.Duplex) { dup := func(byt []byte) []byte { - n := make([]byte, len(byt)) + n := globuf[:len(byt)] copy(n, byt) return n } diff --git a/importer/chunk/splitting.go b/importer/chunk/splitting.go index f5a6f735c..8198999a8 100644 --- a/importer/chunk/splitting.go +++ b/importer/chunk/splitting.go @@ -8,7 +8,7 @@ import ( var log = util.Logger("chunk") -var DefaultSplitter = &SizeSplitter{Size: 1024 * 512} +var DefaultSplitter = &SizeSplitter{Size: 1024 * 256} type BlockSplitter interface { Split(r io.Reader) chan []byte diff --git a/net/conn/conn.go b/net/conn/conn.go index 342be71bb..272a31c3b 100644 --- a/net/conn/conn.go +++ b/net/conn/conn.go @@ -22,7 +22,7 @@ const ( ChanBuffer = 10 // MaxMessageSize is the size of the largest single message - MaxMessageSize = 1 << 21 // 4 MB + MaxMessageSize = 1 << 20 // HandshakeTimeout for when nodes first connect HandshakeTimeout = time.Second * 5