Skip to content

Commit

Permalink
[patch] divide benchmark code for fixing licence problem
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
  • Loading branch information
kpango committed May 15, 2020
1 parent 67ace39 commit 3b5e7af
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 811 deletions.
6 changes: 0 additions & 6 deletions gache.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"github.com/kpango/fastime"
"github.com/zeebo/xxh3"
"golang.org/x/sync/singleflight"
// "github.com/klauspost/compress/s2"
// "github.com/pierrec/lz4"
)

type (
Expand Down Expand Up @@ -405,9 +403,7 @@ func (g *gache) Write(ctx context.Context, w io.Writer) error {
})
gob.Register(map[string]interface{}{})

// return gob.NewEncoder(s2.NewWriter(w)).Encode(&m)
return gob.NewEncoder(w).Encode(&m)
// return gob.NewEncoder(lz4.NewWriter(w)).Encode(&m)
}

// Write writes all cached data to writer
Expand All @@ -419,9 +415,7 @@ func Write(ctx context.Context, w io.Writer) error {
func (g *gache) Read(r io.Reader) error {
var m map[string]interface{}
gob.Register(map[string]interface{}{})
// err := gob.NewDecoder(s2.NewReader(r)).Decode(&m)
err := gob.NewDecoder(r).Decode(&m)
// err := gob.NewDecoder(lz4.NewReader(r)).Decode(&m)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 3b5e7af

Please sign in to comment.