Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions benchmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ var benchmarkCases = []BenchmarkCase{

TimeSupport: TSFullTzOffset,
APIKind: AKManual,
Notes: []string{"low level IDR encoding demo with same nsec time encoding as benc"},
}, {
Name: "idr/reuse",
URL: "github.com/chmike/ditp",
Expand All @@ -488,7 +487,6 @@ var benchmarkCases = []BenchmarkCase{
BufferReuseMarshal: true,
TimeSupport: TSFullTzOffset,
APIKind: AKManual,
Notes: []string{"low level IDR encoding demo with same nsec time encoding as benc"},
}, {
Name: "baseline",
URL: "",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Sereal/Sereal v0.0.0-20230201113653-fa72c87b650e
github.com/alecthomas/binary v0.0.0-20221018225505-74871811ee56
github.com/calmh/xdr v1.1.0
github.com/chmike/ditp v0.0.0-20240629115045-1ab5bbd646cd
github.com/chmike/ditp v0.0.0-20260529191559-ba1cb46039fd
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cybriq/gotiny v0.0.5
github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ github.com/calmh/xdr v1.1.0/go.mod h1:E8sz2ByAdXC8MbANf1LCRYzedSnnc+/sXXJs/PVqoe
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/chmike/ditp v0.0.0-20240629115045-1ab5bbd646cd h1:ImEBzQdUJ6jx65nsFrBlNNV8um9lW4ApGEa+mIjXOZQ=
github.com/chmike/ditp v0.0.0-20240629115045-1ab5bbd646cd/go.mod h1:Az8w1aHUmNFs7+C7v41Y/cpXIBafvOs+7J7M/KGsM1c=
github.com/chmike/ditp v0.0.0-20260529191559-ba1cb46039fd h1:/c6s2zKoMTf3CkD4nHRUkXvgXAAFgmtbPOplfqf+4jw=
github.com/chmike/ditp v0.0.0-20260529191559-ba1cb46039fd/go.mod h1:q1+/FOd94RbDMj7S7AaevpEUiVLIY4jKlE0mZ4Wussc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down
24 changes: 12 additions & 12 deletions internal/serializers/idr/idr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ type IDRSerializer struct {
func (s IDRSerializer) Marshal(o interface{}) ([]byte, error) {
v := o.(*goserbench.SmallStruct)
e := make([]byte, 0, 64)
e = low.PutTime(e, v.BirthDay)
e = low.PutFloat64(e, v.Money)
e = low.PutBool(e, v.Spouse)
e = low.PutVarInt(e, v.Siblings)
e = low.PutString(e, v.Name)
e = low.PutString(e, v.Phone)
e = low.AppendTime(e, v.BirthDay)
e = low.AppendFloat64(e, v.Money)
e = low.AppendBool(e, v.Spouse)
e = low.AppendVarInt(e, v.Siblings)
e = low.AppendString(e, v.Name)
e = low.AppendString(e, v.Phone)
return e, nil
}

Expand All @@ -42,12 +42,12 @@ type IDRSerializerReuse struct {
func (s IDRSerializerReuse) Marshal(o interface{}) ([]byte, error) {
v := o.(*goserbench.SmallStruct)
e := low.Reset(s.e)
e = low.PutTime(e, v.BirthDay)
e = low.PutFloat64(e, v.Money)
e = low.PutBool(e, v.Spouse)
e = low.PutVarInt(e, v.Siblings)
e = low.PutString(e, v.Name)
e = low.PutString(e, v.Phone)
e = low.AppendTime(e, v.BirthDay)
e = low.AppendFloat64(e, v.Money)
e = low.AppendBool(e, v.Spouse)
e = low.AppendVarInt(e, v.Siblings)
e = low.AppendString(e, v.Name)
e = low.AppendString(e, v.Phone)
return e, nil
}

Expand Down
Loading