两个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