Skip to content

[P3] Proposal: fastcodec for Hessian2 #28

@felix021

Description

@felix021

In the first version of codec-hessian2, we'll be using the dubbo-go-hessian2 to provide encoding and decoding of hessian2.

As the dubbo-go-hessian2 uses reflection, we realize that there's room for further optimization.

So in our implementation of dubbo protocol, we defined two interfaces Encoder and Decoder, so that we can replace it with another library.

This proposal suggests the implemention of a new Hessian2 encoder/decoder to achieve the best performance.

Take thrift as an example:

  • The official (apache) way is to generate all the go code for encoding/decoding, to avoid the use of reflection.
  • Kitex goes further with the fastcodec implementation, by generating the BLength() method to calculate the length of the encoded binary, we can allocate only once before encoding, thus greatly improving the performance.

This proposal suggests to implement a fastcodec library for hessian2.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions