|
1 | 1 | # MessagePack encoding for Golang |
2 | 2 |
|
3 | | -[](https://travis-ci.org/vmihailenco/msgpack) |
| 3 | +[](https://github.com/Basekick-Labs/msgpack/actions/workflows/build.yml) |
4 | 4 | [](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5) |
5 | | -[](https://msgpack.uptrace.dev/) |
6 | | -[](https://discord.gg/rWtp5Aj) |
| 5 | +[](https://discord.gg/nxnWfUxsdm) |
7 | 6 |
|
8 | | -> msgpack is brought to you by :star: [**uptrace/uptrace**](https://github.com/uptrace/uptrace). |
9 | | -> Uptrace is an [open source APM](https://uptrace.dev/get/open-source-apm.html) and blazingly fast |
10 | | -> [distributed tracing tool](https://get.uptrace.dev/compare/distributed-tracing-tools.html) powered |
11 | | -> by OpenTelemetry and ClickHouse. Give it a star as well! |
| 7 | +> A performance-optimized fork of [vmihailenco/msgpack/v5](https://github.com/vmihailenco/msgpack), |
| 8 | +> maintained by [Basekick Labs](https://github.com/Basekick-Labs). Built for |
| 9 | +> [Arc](https://github.com/Basekick-Labs/arc), a high-performance time-series database. |
| 10 | +> The upstream module path is preserved for drop-in compatibility. |
| 11 | +
|
| 12 | +## What's New in v6 |
| 13 | + |
| 14 | +**Decode** — ~21% faster, ~50% less memory: |
| 15 | +- Zero-allocation byte-slice reader for `Unmarshal()` |
| 16 | +- `*interface{}` fast path bypasses reflect for the most common decode pattern |
| 17 | + |
| 18 | +**Encode** — ~12% faster, ~43% fewer allocations: |
| 19 | +- Pooled byte buffer in `Marshal()` eliminates per-call `bytes.Buffer` |
| 20 | +- Native `WriteByte` on the Marshal path removes per-byte heap allocations |
| 21 | +- Type-switch fast paths for `map[string]interface{}` and `[]interface{}` |
| 22 | + |
| 23 | +**Security:** |
| 24 | +- OOM protection: slice and map allocations from untrusted input are capped at 1M elements |
| 25 | + |
| 26 | +See [CHANGELOG.md](CHANGELOG.md) for full details. |
12 | 27 |
|
13 | 28 | ## Resources |
14 | 29 |
|
15 | | -- [Documentation](https://msgpack.uptrace.dev) |
16 | | -- [Chat](https://discord.gg/rWtp5Aj) |
| 30 | +- [Discord](https://discord.gg/nxnWfUxsdm) |
17 | 31 | - [Reference](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5) |
18 | 32 | - [Examples](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5#pkg-examples) |
19 | 33 |
|
@@ -53,7 +67,7 @@ msgpack supports 2 last Go versions and requires support for |
53 | 67 | go mod init github.com/my/repo |
54 | 68 | ``` |
55 | 69 |
|
56 | | -And then install msgpack/v5 (note _v5_ in the import; omitting it is a popular mistake): |
| 70 | +And then install msgpack (the module path is unchanged from upstream for drop-in compatibility): |
57 | 71 |
|
58 | 72 | ```shell |
59 | 73 | go get github.com/vmihailenco/msgpack/v5 |
@@ -84,17 +98,10 @@ func ExampleMarshal() { |
84 | 98 | } |
85 | 99 | ``` |
86 | 100 |
|
87 | | -## See also |
88 | | - |
89 | | -- [Golang ORM](https://github.com/uptrace/bun) for PostgreSQL, MySQL, MSSQL, and SQLite |
90 | | -- [Golang PostgreSQL](https://bun.uptrace.dev/postgres/) |
91 | | -- [Golang HTTP router](https://github.com/uptrace/bunrouter) |
92 | | -- [Golang ClickHouse ORM](https://github.com/uptrace/go-clickhouse) |
93 | | - |
94 | 101 | ## Contributors |
95 | 102 |
|
96 | 103 | Thanks to all the people who already contributed! |
97 | 104 |
|
98 | | -<a href="https://github.com/vmihailenco/msgpack/graphs/contributors"> |
99 | | - <img src="https://contributors-img.web.app/image?repo=vmihailenco/msgpack" /> |
| 105 | +<a href="https://github.com/Basekick-Labs/msgpack/graphs/contributors"> |
| 106 | + <img src="https://contributors-img.web.app/image?repo=Basekick-Labs/msgpack" /> |
100 | 107 | </a> |
0 commit comments