Json解析性能比较笔记(一)

通过对Android内置、JSONSimple及Jackson等JSON解析器的性能测试,得出Jackson在Android平台上的解析速度最快。测试使用了TraceView工具进行辅助评估。

两个json解析性能比较参考地址:


一、Comparison of JSON Parsers Performance on Android

http://www.martinadamek.com/2011/01/31/comparison-of-json-parsers-performance-on-android/


1、简述:

本文主要讲述通过TraceView粗略的测试Android built-in、JSONSimple、Jacketson所得到的结果。

  • Android built-in: 277ms
  • JSON.simple: 176ms
  • Jackson: 99ms

然而,有句话值得学习“it is a pretty stupid kind of a comparison (I am not even calling it benchmark :-) and code is not exactly one shining example of an Android app, but it could give you an idea. ”从中我得到了"an good idea",既获取了JSON Parsers 的一个答案,也获取了一个以前未接触到的思路"TraceView",更体会到那一丝对编程专研的热情和严谨。


2、延伸:TraceView

上文中提到了TraceView这个Android官方提到的Performance测试工具,个人觉得也非常有用

---可学习参考:

2.1、How can I test an application for performance in Android?

http://stackoverflow.com/questions/1957135/how-to-test-the-performance-of-an-android-application


2.2、官网地址:

http://developer.android.com/intl/zh-CN/tools/debugging/debugging-tracing.html


2.3、参考资料:

http://blog.youkuaiyun.com/xiaominghimi/article/details/6105212


二、JSON Parsers Performance on Android (With Warmup and Multiple Iterations)

http://www.martinadamek.com/2011/02/04/json-parsers-performance-on-android-with-warmup-and-multiple-iterations/


1、简述:

本文是对上一篇的补充,并通过更严谨的测试获取了一个结果。

大致是jackson > gson > android buit-in > jsonsimple


三、参考工程源码地址:

https://github.com/martinadamek/json-android-compare


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值