From efeab520bc0ee6035b26e3226bc21772dccb6cf2 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Mon, 22 Feb 2016 12:29:17 +0000 Subject: [PATCH 1/2] Bump github.com/ugorji/go/codec To reduce garbage from simpleIoEncWriterWriter (https://github.com/ugorji/go/issues/143) --- vendor/github.com/ugorji/go/codec/encode.go | 5 ++++- vendor/manifest | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go index a874c744b..a60daa236 100644 --- a/vendor/github.com/ugorji/go/codec/encode.go +++ b/vendor/github.com/ugorji/go/codec/encode.go @@ -141,13 +141,16 @@ type simpleIoEncWriterWriter struct { w io.Writer bw io.ByteWriter sw ioEncStringWriter + bs [1]byte } func (o *simpleIoEncWriterWriter) WriteByte(c byte) (err error) { if o.bw != nil { return o.bw.WriteByte(c) } - _, err = o.w.Write([]byte{c}) + // _, err = o.w.Write([]byte{c}) + o.bs[0] = c + _, err = o.w.Write(o.bs[:]) return } diff --git a/vendor/manifest b/vendor/manifest index b2041fe2e..7a3a614f0 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -796,7 +796,7 @@ { "importpath": "github.com/ugorji/go/codec", "repository": "https://github.com/ugorji/go", - "revision": "9f21f8ea305046b8d17a799e2c73069533a99d24", + "revision": "03b46f3d7a8e0457836a5ecd906b4961a5815a63", "branch": "master", "path": "/codec" }, From 996062d64beb8642732fea368cb7a97313dc6386 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Mon, 22 Feb 2016 13:41:03 +0000 Subject: [PATCH 2/2] Build github.com/ugorji/go/codec with -tags unsafe See https://github.com/ugorji/go/issues/143#issue-134950331 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4e4900fa2..a01f809b7 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ RUN_FLAGS=-ti BUILD_IN_CONTAINER=true GO ?= env GO15VENDOREXPERIMENT=1 go GO_BUILD_INSTALL_DEPS=-i -GO_BUILD_TAGS=-tags netgo +GO_BUILD_TAGS=-tags 'netgo unsafe' GO_BUILD_FLAGS=$(GO_BUILD_INSTALL_DEPS) -ldflags "-extldflags \"-static\" -X main.version=$(SCOPE_VERSION)" $(GO_BUILD_TAGS) all: $(SCOPE_EXPORT)