lab010

command
v0.0.0-...-f10d331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 4 Imported by: 0

README

测试pb的二进制的字节大小

我们对于map有两种处理办法,一种是直接用protobuf的map,还有一个是在服务器上把map里面数据转换到string,再放入protobuf中 。这个实验是对比一下两个方式来存数据,protobuf转换到二进制数据的时候的字节大小

运行结果

itemMap的大小 resMap1的大小 resMap2的大小
1 9 8
3 21 22
5 33 36
10 65 71
300 2788 2411
1000 9790 8711

可以看出这个大小,在原始数据不一样的时候,二进制的大小也不一样。

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL