Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问为什么请求和返回用hessian 序列化后再做一次 base64? #220

Open
lossend opened this issue Dec 5, 2023 · 2 comments

Comments

@lossend
Copy link

lossend commented Dec 5, 2023

如果是为了调用前的参数,只需要 hessian 序列化就可以,还需要多做一次 base64?
如果是为了子调用匹配更快速的话,那么牺牲的岂不是内存?
还有 base64 之后如果对数据要做压缩传输的话,大多数压缩算法的压缩比对于 bas64 的字符会有明显的降低,这个算不算是一种牺牲?

@Aresxue
Copy link

Aresxue commented Apr 25, 2024

hessian2序列化后是byte数组需要转成string,至于为什么是base64现在看是一个比较拍脑袋的选择,确实有很多比base64更好的选择,子调用匹配的速度和这个没关系。

@Aresxue
Copy link

Aresxue commented Jun 27, 2024

接上,将base64替换为单字节编码后流量体积明显减少,对内存网络io都有不小的提升,带来的副作用是无法直接复制粘贴序列化后的字符串进行反序列化,由于我们的流量是放入es明文存储所以此缺点影响不大,但对于原生的数据库模式会降低排查问题的效率

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants