kitex version >= v0.4.0
Fastpb is a protobuf enhancement plugin developed by ByteDance. It uses the new generated code and API to complete the protobuf encoding and decoding process. Compared to the official sdk, it avoids go-reflect and thus has better performance.
Performance comparison with the official protobuf please refer to here. More Fastpb details see here.
Usage (enabled by default)
Kitex integrates Fastpb by default. When using the
kitex command-tool to generate code,
xx.pb.fast.go file will be added next to the official generated code file
xx.pb.go for Fastpb faster codec.
How to Disable ?
When using the
kitex command line to generate code, add
-no-fast-api to disable Fastpb.
xx.pb.fast.go files can also disable Fastpb. After deleting these files,
the Kitex framework will automatically adapt to the official sdk for encoding/decoding.
Was this page helpful?
Please tell us how we can improve.