mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-06-08 04:17:42 +00:00
doc[protocol]: 更新文档
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 56 KiB |
+1
-1
@@ -3,7 +3,7 @@
|
||||
- zfoo protocol是目前的Java二进制序列化和反序列化最快的框架,并且线程安全
|
||||
- 协议目前原生支持Java Javascript C# Lua,协议理论上可以跨平台
|
||||
- 使用Javassist字节码增强动态生成顺序执行的序列化和反序列化函数,顺序执行的函数可以轻易的被JIT编译以达到极致的性能
|
||||
- 单线程环境,在没有任何JVM参数调优的情况下速度比Kryo快40%,比Protobuf快110%,[参见性能测试](src/test/java/com/zfoo/protocol/SpeedTest.java)
|
||||
- 单线程环境,在没有任何JVM参数调优的情况下速度比Protobuf快20%,比Kryo快40%,[参见性能测试](src/test/java/com/zfoo/protocol/SpeedTest.java)
|
||||
- 多线程环境,zfoo和Protobuf的性能不受任何影响,kryo因为线程不安全性能会有所损失,[参见性能测试](src/test/java/com/zfoo/protocol/SpeedTest.java)
|
||||
|
||||
### Ⅱ. 快速使用
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SpeedTest {
|
||||
/**
|
||||
* 单线程性能测试
|
||||
* <p>
|
||||
* 不使用任何JVM参数:zfoo比kryo快40%,zfoo比protobuf快110%
|
||||
* 不使用任何JVM参数:zfoo比protobuf快20%,zfoo比kryo快40%
|
||||
* <p>
|
||||
* 包体大小:
|
||||
* 简单对象,zfoo包体大小8,kryo包体大小5,protobuf包体大小8
|
||||
@@ -63,8 +63,8 @@ public class SpeedTest {
|
||||
System.out.println(StringUtils.format("[单线程性能测试-->[benchmark:{}]]", benchmark));
|
||||
|
||||
zfooTest();
|
||||
kryoTest();
|
||||
protobufTest();
|
||||
kryoTest();
|
||||
|
||||
benchmark = benchmark * 2;
|
||||
singleThreadBenchmarks();
|
||||
@@ -83,8 +83,8 @@ public class SpeedTest {
|
||||
System.out.println(StringUtils.format("[多线程性能测试-->[benchmark:{}]]", benchmark));
|
||||
|
||||
zfooMultipleThreadTest();
|
||||
kryoMultipleThreadTest();
|
||||
protobufMultipleThreadTest();
|
||||
kryoMultipleThreadTest();
|
||||
|
||||
benchmark = benchmark * 2;
|
||||
multipleThreadBenchmarks();
|
||||
|
||||
Reference in New Issue
Block a user