Commit 02792054 authored by Jeromy's avatar Jeromy

more memory tweaks

parent 9b1c99e9
......@@ -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
}
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment