@cryptotaxi247 / kubo / commits / 027920540

more memory tweaks

Jeromy committed Oct 28, 2014 at 02:53 UTC 027920540ffccb18bac61cb4ceda15527fb5a3cd
3 files changed +5 -3
crypto/spipe/spipe_test.go
+3 -1
@@ -36,9 +36,11 @@ func bindDuplexNoCopy(a, b pipes.Duplex) {
36 }
37 }
38
39 +var globuf = make([]byte, 4*1024*1024)
40 +
41 func bindDuplexWithCopy(a, b pipes.Duplex) {
42 dup := func(byt []byte) []byte {
41 - n := make([]byte, len(byt))
43 + n := globuf[:len(byt)]
44 copy(n, byt)
45 return n
46 }
importer/chunk/splitting.go
+1 -1
@@ -8,7 +8,7 @@ import (
8
9 var log = util.Logger("chunk")
10
11 -var DefaultSplitter = &SizeSplitter{Size: 1024 * 512}
11 +var DefaultSplitter = &SizeSplitter{Size: 1024 * 256}
12
13 type BlockSplitter interface {
14 Split(r io.Reader) chan []byte
net/conn/conn.go
+1 -1
@@ -22,7 +22,7 @@ const (
22 ChanBuffer = 10
23
24 // MaxMessageSize is the size of the largest single message
25 - MaxMessageSize = 1 << 21 // 4 MB
25 + MaxMessageSize = 1 << 20
26
27 // HandshakeTimeout for when nodes first connect
28 HandshakeTimeout = time.Second * 5