diff --git a/go.mod b/go.mod index bb74a27d..1d12fb42 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/peterh/liner v1.2.1 github.com/streadway/amqp v1.0.0 github.com/tidwall/btree v0.4.2 - github.com/tidwall/buntdb v1.2.1 + github.com/tidwall/buntdb v1.2.2 github.com/tidwall/geoindex v1.4.3 github.com/tidwall/geojson v1.2.7 github.com/tidwall/gjson v1.7.4 diff --git a/go.sum b/go.sum index 61739170..1e5609f9 100644 --- a/go.sum +++ b/go.sum @@ -118,6 +118,8 @@ github.com/tidwall/btree v0.4.2 h1:aLwwJlG+InuFzdAPuBf9YCAR1LvSQ9zhC5aorFPlIPs= github.com/tidwall/btree v0.4.2/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8= github.com/tidwall/buntdb v1.2.1 h1:+s5TqjuAfo6IdMa8boDkCx5PzT2mlP5AwgNN4yxJba8= github.com/tidwall/buntdb v1.2.1/go.mod h1:4FUodsOaaFBuhPvQyTafaxVM5GFdQZnz98W3BaNmve4= +github.com/tidwall/buntdb v1.2.2 h1:46G3ulKw8NYo0JAvsZkf7Xq1c8OHOPRuHQVTfL6z+lE= +github.com/tidwall/buntdb v1.2.2/go.mod h1:+i/gBwYOHWG19wLgwMXFLkl00twh9+VWkkaOhuNQ4PA= github.com/tidwall/cities v0.1.0 h1:CVNkmMf7NEC9Bvokf5GoSsArHCKRMTgLuubRTHnH0mE= github.com/tidwall/cities v0.1.0/go.mod h1:lV/HDp2gCcRcHJWqgt6Di54GiDrTZwh1aG2ZUPNbqa4= github.com/tidwall/geoindex v1.4.3 h1:zowx7LtzibIE6JPbL6CRgVgw9qp13dJ8Pzfa4/f+4us= @@ -130,6 +132,8 @@ github.com/tidwall/grect v0.1.1 h1:+kMEkxhoqB7rniVXzMEIA66XwU07STgINqxh+qVIndY= github.com/tidwall/grect v0.1.1/go.mod h1:CzvbGiFbWUwiJ1JohXLb28McpyBsI00TK9Y6pDWLGRQ= github.com/tidwall/lotsa v1.0.1 h1:w4gpDvI7RdkgbMC0q5ndKqG2ffrwCgerUY/gM2TYkH4= github.com/tidwall/lotsa v1.0.1/go.mod h1:X6NiU+4yHA3fE3Puvpnn1XMDrFZrE9JO2/w+UMuqgR8= +github.com/tidwall/lotsa v1.0.2 h1:dNVBH5MErdaQ/xd9s769R31/n2dXavsQ0Yf4TMEHHw8= +github.com/tidwall/lotsa v1.0.2/go.mod h1:X6NiU+4yHA3fE3Puvpnn1XMDrFZrE9JO2/w+UMuqgR8= github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= diff --git a/vendor/github.com/tidwall/buntdb/buntdb.go b/vendor/github.com/tidwall/buntdb/buntdb.go index 243e873a..9f17322b 100644 --- a/vendor/github.com/tidwall/buntdb/buntdb.go +++ b/vendor/github.com/tidwall/buntdb/buntdb.go @@ -861,6 +861,7 @@ func (db *DB) readLoad(rd io.Reader, modTime time.Time) (n int64, err error) { } // copy string parts = append(parts, string(data[:n])) + cmdByteSize += int64(n + 2) } // finished reading the command diff --git a/vendor/github.com/tidwall/buntdb/go.mod b/vendor/github.com/tidwall/buntdb/go.mod index 85a2d8ec..cd77790c 100644 --- a/vendor/github.com/tidwall/buntdb/go.mod +++ b/vendor/github.com/tidwall/buntdb/go.mod @@ -6,6 +6,7 @@ require ( github.com/tidwall/btree v0.4.2 github.com/tidwall/gjson v1.7.4 github.com/tidwall/grect v0.1.1 + github.com/tidwall/lotsa v1.0.2 github.com/tidwall/match v1.0.3 github.com/tidwall/rtred v0.1.2 ) diff --git a/vendor/github.com/tidwall/buntdb/go.sum b/vendor/github.com/tidwall/buntdb/go.sum index 38dd895f..8cf5f843 100644 --- a/vendor/github.com/tidwall/buntdb/go.sum +++ b/vendor/github.com/tidwall/buntdb/go.sum @@ -4,6 +4,8 @@ github.com/tidwall/gjson v1.7.4 h1:19cchw8FOxkG5mdLRkGf9jqIqEyqdZhPqW60XfyFxk8= github.com/tidwall/gjson v1.7.4/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= github.com/tidwall/grect v0.1.1 h1:+kMEkxhoqB7rniVXzMEIA66XwU07STgINqxh+qVIndY= github.com/tidwall/grect v0.1.1/go.mod h1:CzvbGiFbWUwiJ1JohXLb28McpyBsI00TK9Y6pDWLGRQ= +github.com/tidwall/lotsa v1.0.2 h1:dNVBH5MErdaQ/xd9s769R31/n2dXavsQ0Yf4TMEHHw8= +github.com/tidwall/lotsa v1.0.2/go.mod h1:X6NiU+4yHA3fE3Puvpnn1XMDrFZrE9JO2/w+UMuqgR8= github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= diff --git a/vendor/github.com/tidwall/lotsa/lotsa.go b/vendor/github.com/tidwall/lotsa/lotsa.go index 7071b0ae..4f16fe3e 100644 --- a/vendor/github.com/tidwall/lotsa/lotsa.go +++ b/vendor/github.com/tidwall/lotsa/lotsa.go @@ -49,9 +49,14 @@ func Ops(count, threads int, op func(i, thread int)) { dur := time.Since(start) var alloc uint64 if MemUsage { + runtime.GC() var ms2 runtime.MemStats runtime.ReadMemStats(&ms2) - alloc = ms2.HeapAlloc - ms1.HeapAlloc + if ms1.HeapAlloc > ms2.HeapAlloc { + alloc = 0 + } else { + alloc = ms2.HeapAlloc - ms1.HeapAlloc + } } WriteOutput(output, count, threads, dur, alloc) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 5d26ef08..257177be 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -117,7 +117,7 @@ github.com/streadway/amqp # github.com/tidwall/btree v0.4.2 ## explicit github.com/tidwall/btree -# github.com/tidwall/buntdb v1.2.1 +# github.com/tidwall/buntdb v1.2.2 ## explicit github.com/tidwall/buntdb # github.com/tidwall/cities v0.1.0 @@ -137,7 +137,7 @@ github.com/tidwall/geojson/geometry github.com/tidwall/gjson # github.com/tidwall/grect v0.1.1 github.com/tidwall/grect -# github.com/tidwall/lotsa v1.0.1 +# github.com/tidwall/lotsa v1.0.2 github.com/tidwall/lotsa # github.com/tidwall/match v1.0.3 ## explicit