Browse Source

codec: updated caveat on binary sizes

Ugorji Nwoke 6 years ago
parent
commit
65dd1ed12c
2 changed files with 20 additions and 10 deletions
  1. 11 6
      README.md
  2. 9 4
      codec/doc.go

+ 11 - 6
README.md

@@ -244,11 +244,14 @@ Please see http://github.com/ugorji/go-codec-bench .
 
 ## Managing Binary Size
 
-This package could add up to 10MB to the size of your binaries.
+This package adds some size to any binary that depends on it. This is
+because we include an auto-generated file: `fast-path.generated.go` to help
+with performance when encoding/decoding slices and maps of built in numeric,
+boolean, string and interface{} types.
 
-This is because we include some a auto-generated file:
-`fast-path.generated.go` to help with performance when encoding/decoding
-slices and maps of built in numeric, boolean, string and interface{} types.
+Prior to 2019-05-16, this package could add about 11MB to the size of your
+binaries. We have now trimmed that in half, and the package contributes
+about 5.5MB.
 
 You can override this by building (or running tests and benchmarks) with the
 tag: `notfastpath`.
@@ -259,9 +262,11 @@ tag: `notfastpath`.
     go test -tags notfastpath
 ```
 
+With the tag `notfastpath`, we trim that size to about 2.9MB.
+
 Be aware that, at least in our representative microbenchmarks for cbor (for
-example), we see up to 33% increase in decoding and 50% increase in encoding
-speeds. YMMV.
+example), passing `notfastpath` tag causes up to 33% increase in decoding
+and 50% increase in encoding speeds. YMMV.
 
 
 ## Caveats

+ 9 - 4
codec/doc.go

@@ -209,12 +209,14 @@ Please see http://github.com/ugorji/go-codec-bench .
 
 Managing Binary Size
 
-This package could add up to 10MB to the size of your binaries.
-
-This is because we include some a auto-generated file: `fast-path.generated.go`
+This package adds some size to any binary that depends on it.
+This is because we include an auto-generated file: `fast-path.generated.go`
 to help with performance when encoding/decoding slices and maps of
 built in numeric, boolean, string and interface{} types.
 
+Prior to 2019-05-16, this package could add about 11MB to the size of your binaries.
+We have now trimmed that in half, and the package contributes about 5.5MB.
+
 You can override this by building (or running tests and benchmarks)
 with the tag: `notfastpath`.
 
@@ -222,8 +224,11 @@ with the tag: `notfastpath`.
     go build -tags notfastpath
     go test -tags notfastpath
 
+With the tag `notfastpath`, we trim that size to about 2.9MB.
+
 Be aware that, at least in our representative microbenchmarks for cbor (for example),
-we see up to 33% increase in decoding and 50% increase in encoding speeds.
+passing `notfastpath` tag causes up to 33% increase in decoding and
+50% increase in encoding speeds.
 YMMV.
 
 Caveats