Skip to content

Commit d4e3a2c

Browse files
committed
docs: update protobuf packed encoding blog post.
1 parent ce733be commit d4e3a2c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_posts/2026-01-18-protobuf-packed-encoding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Protocol Buffers(简称 Protobuf)是 Google 开发的一种高效的数据
3737

3838
| 特性 | 不使用 packed | 使用 packed=true |
3939
|------|:-------------:|:----------------:|
40-
| **编码方式** | 每个元素单独编码,每个值都带 tag+type+value | 所有元素打包成连续字节块,只有一个 tag+length |
40+
| **编码方式** | 每个元素单独编码,每个值都带 tag+type+value | 所有元素打包成连续字节块,仅需一个 tag+length 头部,后跟所有 value |
4141
| **Wire Type** | Varint (0) | Length-delimited (2) |
4242
| **Tag 开销** | 100 × 1 = **100 字节** | 1 字节 |
4343
| **Length 开销** || 2 字节 |

0 commit comments

Comments
 (0)