性能及Android的JSON库可用性比较 [英] Performance and Usability comparison of Android JSON libraries

查看:108
本文介绍了性能及Android的JSON库可用性比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在Android解析JSON最好的图书馆在那里。我知道Android框架提供一个内置的JSON库,而且我听说GSON的。但我不知道是否有人比Android上的各种JSON选项,并想出一个理由,选择一个比其他。我想的性能和可用性为主要标准。

What is the best library out there for parsing JSON on android. I know the Android framework has a JSON library built in, and I've heard of GSON. But I'm wondering if anyone has compared the various JSON options on android and come up with a justification for choosing one over the other. I'm thinking of performance and usability as the main criteria.

推荐答案

虽然有极少数的Java到/从-JSON的API,提供了简单的(基本)JSON和任意的Java数据结构,杰克逊之间的结合GSON是目前最先进的(能力)和功能丰富的选项。

While there is a handful of Java-to/from-JSON APIs that provide for easy (basic) binding between JSON and an arbitrary Java data structure, Jackson and Gson are by far the most sophisticated (capable) and feature-rich options.

早在七月(2011年),我贴了多部分组成的系列我的博客上使用GSON与杰克逊相比,通过功能加强,因为他们组织了GSON用户指南中,包括具有可比性的实现在杰克逊例子的实现(与在GSON,其中GSON用户指南不全或损坏)。

Back in July (2011), I posted a multi-part series on my blog comparing using Gson versus Jackson, stepping through features as they were organized in the Gson User Guide, including examples of comparable implementations in Jackson (and of implementations in Gson, where the Gson User Guide was incomplete or broken).

本系列的第六部分提供了方便的导航链接的比较,以及总结的比较列表。 <一href="http://programmerbruce.blogspot.com/2011/07/gson-v-jackson-part-6.html">http://programmerbruce.blogspot.com/2011/07/gson-v-jackson-part-6.html

The sixth part of the series provides easy navigation links for the comparison, as well as a summary comparison listing. http://programmerbruce.blogspot.com/2011/07/gson-v-jackson-part-6.html

这是使用GSON与杰克逊共同JSON-向/从Java的任务众所周知的。

This is the most comprehensive comparison of using Gson versus Jackson for common JSON-to/from-Java tasks known.

如前所述,可在<一个不同的Java到/从-JSON API的性能比较href="https://github.com/eishay/jvm-serializers/wiki">https://github.com/eishay/jvm-serializers/wiki. GSON的当前版本(2.0)显示比杰克逊(1.9.2)中的序列化和反序列化一个500字节的JSON结构,使用非常具有可比性的执行工作($ C的只是一个或两行当前版本慢16倍左右$ C)。

As mentioned, performance comparisons of various Java-to/from-JSON APIs are available at https://github.com/eishay/jvm-serializers/wiki. The current release of Gson (2.0) shows to be about 16 times slower than the current release of Jackson (1.9.2) at serializing and deserializing a 500 byte JSON structure, using very comparable implementation efforts (just one or two lines of code).

马丁·阿达梅克张贴在Android上运行的各种API的一些性能测试结果,在<一个href="http://martinadamek.com/2011/01/31/comparison-of-json-parsers-performance-on-android/">http://martinadamek.com/2011/01/31/comparison-of-json-parsers-performance-on-android/和<一href="http://martinadamek.com/2011/02/04/json-parsers-performance-on-android-with-warmup-and-multiple-iterations/">http://martinadamek.com/2011/02/04/json-parsers-performance-on-android-with-warmup-and-multiple-iterations/

Martin Adamek posted some performance results of various APIs running on Android at http://martinadamek.com/2011/01/31/comparison-of-json-parsers-performance-on-android/ and http://martinadamek.com/2011/02/04/json-parsers-performance-on-android-with-warmup-and-multiple-iterations/

这篇关于性能及Android的JSON库可用性比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆