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

反序列化fastjson2比fastjson慢3倍多 #2189

Closed
ananas-xxj opened this issue Jan 15, 2024 · 7 comments
Closed

反序列化fastjson2比fastjson慢3倍多 #2189

ananas-xxj opened this issue Jan 15, 2024 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@ananas-xxj
Copy link

问题描述

如题,fastjson2不是优化了解析速度吗?

环境信息

  • OS信息: [android7]
  • JDK信息: [jdk8]
  • 版本信息:[fastjson2:2.0.45.android4]

重现步骤

MGLog.i("MJson",templateDatas);
long startTime = System.currentTimeMillis();
List list = com.alibaba.fastjson.JSON.parseArray(templateDatas, TemplateData.class);
MGLog.i("MJson",String.valueOf(System.currentTimeMillis()-startTime));
long startTime2 = System.currentTimeMillis();
List list2 = com.alibaba.fastjson2.JSON.parseArray(templateDatas, TemplateData.class);
MGLog.i("MJson","2:"+String.valueOf(System.currentTimeMillis()-startTime2));


### 期待的正确结果
fastjson2解析速度应该更快


### 相关日志输出
689
2:1963


#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*
@ananas-xxj ananas-xxj added the bug Something isn't working label Jan 15, 2024
@ananas-xxj
Copy link
Author

我这边测试,这个性能实在是个迷,有时比fastjson快有时候慢,现在就是这种情况吗?跟内存有关?但是我测试内存紧张的时候两个都慢。有点崩溃了,之前调研的时候没跑大量数据,简单跑下看到性能提升很大,现在接进来发现性能不稳定啊。 @wenshao

@ananas-xxj
Copy link
Author

目前没看到fastjson2在Android平台上的测试结果,能否说下是否跑过Android平台的测试,测试结果怎么样呢?谢谢,感谢,期望回答下。

@wenshao
Copy link
Member

wenshao commented Jan 16, 2024

我在华为的Mate40上测试过的场景都是快的,android环境不同的设备是不一样的,fastjson2.android4的性能测试确实没有fastjson 1.1.x.android测试充分。

如果遇到慢的场景,请提供详细的信息,好方便做重现以及优化。

@wangyatong
Copy link

会不会是每一个安卓设备的硬盘性能都不一样, soc 也不一样, 并且就算是一款soc 每一个厂商的理解也不一样导致的?

@wenshao
Copy link
Member

wenshao commented Jan 26, 2024

最近已经在2.0.46.android4版本上做android真机性能优化了

@wenshao wenshao modified the milestones: 2.0.46, 2.0.47 Jan 26, 2024
@wenshao
Copy link
Member

wenshao commented Jan 30, 2024

2.0.46.android5

你帮忙用这个版本在验证下

@wenshao
Copy link
Member

wenshao commented Feb 24, 2024

@wenshao wenshao closed this as completed Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants