日前,欧拉开发者大会(openEuler Developer Day 2023)在京成功举办。中国移动云能力中心在大会上发布并介绍了:移动云向欧拉社区贡献KSPack高性能编解码库。

KSPack: 高性能、多语言、可定制 的通用编解码库
KSPack是有KubeService-stack社区原创项目,并在2023年开始在欧拉社区openEuler codec-sig中进行孵化与运作。 该项目意在解决分布式系统和应用程序架构中常见的跨语言、数据传输过程中,通用且高性能编解码问题, 可以让业务更加专注于交付业务价值
动机
KSPack意在提供一组多语言、高性能编解码package和最佳实践,为任何规模的组织构建服务提供了一种全面、健壮和可信赖支持
目标
构建相当完整、开箱即用的Package集合
- 高性能,多语言,Packagae健壮
 - 无外部版本依赖,自形生态
 - 全能力开放
 - 全自研,无License锁定
 
蓝图
- 自研序列化库
 
KSPack作为一种高效的二进制序列化格式。允许在多种语言之间交换数据。但是速度更快,体积更小。在编解码过程中实现zero-copy 和 多路io复用,性能更高。支持国产化
架构:

- 高性能和可扩展性
 

支持高性能结构化数据编解码。在整个编解码过程中实现更少的内存占用、内存拷贝和cpu占用
性能对标Benchmark:
环境:
- Go 1.19.4
 - MacPro Apple M2 8G macOS Ventura
 - Darwin 192.168.1.7 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:06:26 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8112 arm64
 
goos: darwin
goarch: amd64
pkg: github.com/kubeservice-stack/serialization-benchmarks
cpu: VirtualApple @ 2.50GHz
Benchmark_Bson_Marshal-8         	 2272702	       499.2 ns/op	       110.0 B/serial	     376 B/op	      10 allocs/op
Benchmark_Bson_Unmarshal-8       	 1617357	       716.2 ns/op	       110.0 B/serial	     224 B/op	      19 allocs/op
Benchmark_FastJson_Marshal-8     	 4016576	       296.9 ns/op	       133.8 B/serial	     504 B/op	       6 allocs/op
Benchmark_FastJson_Unmarshal-8   	 1527366	       778.7 ns/op	       133.8 B/serial	    1704 B/op	       9 allocs/op
Benchmark_Gob_Marshal-8          	  467408	      2475 ns/op	       163.6 B/serial	    1616 B/op	      35 allocs/op
Benchmark_Gob_Unmarshal-8        	   95322	     12386 ns/op	       163.6 B/serial	    7688 B/op	     207 allocs/op
Benchmark_JsonIter_Marshal-8     	 1941692	       591.5 ns/op	       148.7 B/serial	     216 B/op	       3 allocs/op
Benchmark_JsonIter_Unmarshal-8   	 1307601	       871.8 ns/op	       148.7 B/serial	     359 B/op	      14 allocs/op
Benchmark_Json_Marshal-8         	 1406618	       850.8 ns/op	       148.6 B/serial	     208 B/op	       2 allocs/op
Benchmark_Json_Unmarshal-8       	  494430	      2153 ns/op	       148.6 B/serial	     399 B/op	       9 allocs/op
Benchmark_KSPack_Marshal-8      	 3624224	       312.8 ns/op	       119.0 B/serial	     344 B/op	       6 allocs/op
Benchmark_KSPack_Unmarshal-8    	 2070897	       574.7 ns/op	       119.0 B/serial	     112 B/op	       3 allocs/op
Benchmark_Msgpack_Marshal-8      	 2961548	       401.9 ns/op	        92.00 B/serial	     264 B/op	       4 allocs/op
Benchmark_Msgpack_Unmarshal-8    	 2209035	       536.9 ns/op	        92.00 B/serial	     160 B/op	       4 allocs/op
PASS
ok  	github.com/kubeservice-stack/serialization-benchmarks	23.928s
- 多语言支持
 
将支持java、golang、rust、c/c++多语言生态
规划
近期将 KSPack 源代码开放至欧拉社区,社区用户可以加入项目开发,共同打造安全、稳定、可靠的国产操作系统生态。
其他
更多信息请关注:https://github.com/kubeservice-stack/Community/tree/main/sig-codec
「如果这篇文章对你有用,请随意打赏」
如果这篇文章对你有用,请随意打赏
使用微信扫描二维码完成支付