Skip to content

Latest commit

History

647 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

MessagePack encoding for Golang

Build StatusPkgGoDevDiscord

A performance-optimized fork of vmihailenco/msgpack/v5, maintained by Basekick Labs. Built for Arc, a high-performance time-series database.

What's New in v6

15 performance optimizations — +8.6% throughput in Arc production benchmarks:

  • Zero-allocation byte-slice reader for Unmarshal() (~21% faster, ~50% less memory)
  • *interface{} fast path bypasses reflect for the most common decode pattern
  • Pooled byte buffer and MarshalAppend API for zero-alloc encode
  • Type-switch fast paths for map[string]interface{}, map[string]string, []interface{}
  • Two-pass OmitEmpty, isZeroer caching, reflect.Convert skip, sorted key pooling
  • sync.Pool replacement for goroutine-per-type value cache

15 bug fixes — including OOM protection, float-to-int decoding, non-addressable pointer encode, and more.

See CHANGELOG.md for full details and the v6.0.0 release.

Resources

Features

Installation

msgpack supports 2 last Go versions and requires support for Go modules. So make sure to initialize a Go module:

go mod init github.com/my/repo

And then install msgpack:

go get github.com/Basekick-Labs/msgpack/v6

Quickstart

import"github.com/Basekick-Labs/msgpack/v6"funcExampleMarshal() {
typeItemstruct {
Foostring
}
b, err:=msgpack.Marshal(&Item{Foo: "bar"})
iferr!=nil {
panic(err)
}
varitemItemerr=msgpack.Unmarshal(b, &item)
iferr!=nil {
panic(err)
}
fmt.Println(item.Foo)
// Output: bar
}

Contributors

Thanks to all the people who already contributed!

About

msgpack.org[Go] MessagePack encoding for Golang

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages