# JSONKit
JSONKit is dual licensed under either the terms of the BSD License, or alternatively under the terms of the Apache License, Version 2.0.<br />
Copyright © 2011, John Engelhart.
### A Very High Performance Objective-C JSON Library
**UPDATE:** (2011/12/18) The benchmarks below were performed before Apples [`NSJSONSerialization`][NSJSONSerialization] was available (as of Mac OS X 10.7 and iOS 5). The obvious question is: Which is faster, [`NSJSONSerialization`][NSJSONSerialization] or JSONKit? According to [this site](http://www.bonto.ch/blog/2011/12/08/json-libraries-for-ios-comparison-updated/), JSONKit is faster than [`NSJSONSerialization`][NSJSONSerialization]. Some quick "back of the envelope" calculations using the numbers reported, JSONKit appears to be approximately 25% to 40% faster than [`NSJSONSerialization`][NSJSONSerialization], which is pretty significant.
Parsing | Serializing
:---------:|:-------------:
<img src="http://chart.googleapis.com/chart?chf=a,s,000000%7Cb0,lg,0,6589C760,0,6589C7B4,1%7Cbg,lg,90,EFEFEF,0,F8F8F8,1&chxl=0:%7CTouchJSON%7CXML+.plist%7Cjson-framework%7CYAJL-ObjC%7Cgzip+JSONKit%7CBinary+.plist%7CJSONKit%7C2:%7CTime+to+Deserialize+in+%C2%B5sec&chxp=2,40&chxr=0,0,5%7C1,0,3250&chxs=0,676767,11.5,1,lt,676767&chxt=y,x,x&chbh=a,5,4&chs=350x185&cht=bhs&chco=6589C783&chds=0,3250&chd=t:410.517,510.262,539.614,1351.257,1683.346,1747.953,2955.881&chg=-1,0,1,3&chm=N+*s*+%C2%B5s,676767,0,0:5,10.5%7CN+*s*+%C2%B5s,3d3d3d,0,6,10.5,,r:-5:1&chem=y;s=text_outline;d=666,10.5,l,fff,_,Decompress+%2b+Parse+is+just;ds=0;dp=2;py=0;of=58,7%7Cy;s=text_outline;d=666,10.5,l,fff,_,5.6%25+slower+than+Binary+.plist%21;ds=0;dp=2;py=0;of=53,-5" width="350" height="185" alt="Deserialize from JSON" /> | <img src="http://chart.googleapis.com/chart?chf=a,s,000000%7Cb0,lg,0,699E7260,0,699E72B4,1%7Cbg,lg,90,EFEFEF,0,F8F8F8,1&chxl=0:%7CTouchJSON%7CYAJL-ObjC%7CXML+.plist%7Cjson-framework%7CBinary+.plist%7Cgzip+JSONKit%7CJSONKit%7C2:%7CTime+to+Serialize+in+%C2%B5sec&chxp=2,40&chxr=0,0,5%7C1,0,3250&chxs=0,676767,11.5,1,lt,676767&chxt=y,x,x&chbh=a,5,4&chs=350x175&cht=bhs&chco=699E7284&chds=0,3250&chd=t:96.387,466.947,626.153,1028.432,1945.511,2156.978,3051.976&chg=-1,0,1,3&chm=N+*s*+%C2%B5s,676767,0,0:5,10.5%7CN+*s*+%C2%B5s,4d4d4d,0,6,10.5,,r:-5:1&chem=y;s=text_outline;d=666,10.5,l,fff,_,Serialize+%2b+Compress+is+34%25;ds=0;dp=1;py=0;of=51,7%7Cy;s=text_outline;d=666,10.5,l,fff,_,faster+than+Binary+.plist%21;ds=0;dp=1;py=0;of=62,-5" width="350" height="185" alt="Serialize to JSON" />
*23% Faster than Binary* <code><em>.plist</em></code>* !* | *549% Faster than Binary* <code><em>.plist</em></code>* !*
* Benchmarking was performed on a MacBook Pro with a 2.66GHz Core 2.
* All JSON libraries were compiled with `gcc-4.2 -DNS_BLOCK_ASSERTIONS -O3 -arch x86_64`.
* Timing results are the average of 1,000 iterations of the user + system time reported by [`getrusage`][getrusage].
* The JSON used was [`twitter_public_timeline.json`](https://github.com/samsoffes/json-benchmarks/blob/master/Resources/twitter_public_timeline.json) from [samsoffes / json-benchmarks](https://github.com/samsoffes/json-benchmarks).
* Since the `.plist` format does not support serializing [`NSNull`][NSNull], the `null` values in the original JSON were changed to `"null"`.
* The [experimental](https://github.com/johnezang/JSONKit/tree/experimental) branch contains the `gzip` compression changes.
* JSONKit automagically links to `libz.dylib` on the fly at run time– no manual linking required.
* Parsing / deserializing will automagically decompress a buffer if it detects a `gzip` signature header.
* You can compress / `gzip` the serialized JSON by passing `JKSerializeOptionCompress` to `-JSONDataWithOptions:error:`.
[JSON versus PLIST, the Ultimate Showdown](http://www.cocoanetics.com/2011/03/json-versus-plist-the-ultimate-showdown/) benchmarks the common JSON libraries and compares them to Apples `.plist` format.
***
JavaScript Object Notation, or [JSON][], is a lightweight, text-based, serialization format for structured data that is used by many web-based services and API's. It is defined by [RFC 4627][].
JSON provides the following primitive types:
* `null`
* Boolean `true` and `false`
* Number
* String
* Array
* Object (a.k.a. Associative Arrays, Key / Value Hash Tables, Maps, Dictionaries, etc.)
These primitive types are mapped to the following Objective-C Foundation classes:
JSON | Objective-C
-------------------|-------------
`null` | [`NSNull`][NSNull]
`true` and `false` | [`NSNumber`][NSNumber]
Number | [`NSNumber`][NSNumber]
String | [`NSString`][NSString]
Array | [`NSArray`][NSArray]
Object | [`NSDictionary`][NSDictionary]
JSONKit uses Core Foundation internally, and it is assumed that Core Foundation ≡ Foundation for every equivalent base type, i.e. [`CFString`][CFString] ≡ [`NSString`][NSString].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119][].
### JSON To Objective-C Primitive Mapping Details
* The [JSON specification][RFC 4627] is somewhat ambiguous about the details and requirements when it comes to Unicode, and it does not specify how Unicode issues and errors should be handled. Most of the ambiguity stems from the interpretation and scope [RFC 4627][] Section 3, Encoding: `JSON text SHALL be encoded in Unicode.` It is the authors opinion and interpretation that the language of [RFC 4627][] requires that a JSON implementation MUST follow the requirements specified in the [Unicode Standard][], and in particular the [Conformance][Unicode Standard - Conformance] chapter of the [Unicode Standard][], which specifies requirements related to handling, interpreting, and manipulating Unicode text.
The default behavior for JSONKit is strict [RFC 4627][] conformance. It is the authors opinion and interpretation that [RFC 4627][] requires JSON to be encoded in Unicode, and therefore JSON that is not legal Unicode as defined by the [Unicode Standard][] is invalid JSON. Therefore, JSONKit will not accept JSON that contains ill-formed Unicode. The default, strict behavior implies that the `JKParseOptionLooseUnicode` option is not enabled.
When the `JKParseOptionLooseUnicode` option is enabled, JSONKit follows the specifications and recommendations given in [The Unicode 6.0 standard, Chapter 3 - Conformance][Unicode Standard - Conformance], section 3.9 *Unicode Encoding Forms*. As a general rule of thumb, the Unicode code point `U+FFFD` is substituted for any ill-formed Unicode encountered. JSONKit attempts to follow the recommended *Best Practice for Using U+FFFD*: ***Replace each maximal subpart of an ill-formed subsequence by a single U+FFFD.***
The following Unicode code points are treated as ill-formed Unicode, and if `JKParseOptionLooseUnicode` is enabled, cause `U+FFFD` to be substituted in their place:
`U+0000`.<br>
`U+D800` thru `U+DFFF`, inclusive.<br>
`U+FDD0` thru `U+FDEF`, inclusive.<br>
<code>U+<i>n</i>FFFE</code> and <code>U+<i>n</i>FFFF</code>, where *n* is from `0x0` to `0x10`
The code points `U+FDD0` thru `U+FDEF`, <code>U+<i>n</i>FFFE</code>, and <code>U+<i>n</i>FFFF</code> (where *n* is from `0x0` to `0x10`), are defined as ***Noncharacters*** by the Unicode standard and "should never be interchanged".
An exception is made for the code point `U+0000`, which is legal Unicode. The reason for this is that this particular code point is used by C string handling code to specify the end of the string, and any such string handling code will incorrectly stop processing a string at the point where `U+0000` occurs. Although reasonable people may have different opinions on this point, it is the authors considered opinio
没有合适的资源?快使用搜索试试~ 我知道了~
mac下最好用的post测试工具
共105个文件
h:78个
plist:5个
strings:4个
5星 · 超过95%的资源 需积分: 50 59 下载量 136 浏览量
2017-11-13
18:14:29
上传
评论
收藏 543KB ZIP 举报
温馨提示
mac下最好用的HttpPost工具,用于网页开发的调试。自带json格式功能,在Tree视图下有时会出错。是目前我见过的mac下Post工具里最好用的
资源推荐
资源详情
资源评论
收起资源包目录
mac下最好用的post测试工具 (105个子文件)
CodeResources 2KB
CodeResources 864B
CodeResources 864B
NSStringEncodingAdditions.h 12KB
NSStringEncodingAdditions.h 12KB
NSStringEncodingAdditions.h 12KB
NSURLRequestAdditions.h 3KB
NSURLRequestAdditions.h 3KB
NSURLRequestAdditions.h 3KB
ICSQLWrapper.h 3KB
ICSQLWrapper.h 3KB
ICSQLWrapper.h 3KB
ICXML.h 3KB
ICXML.h 3KB
ICXML.h 3KB
ICSqlite3.h 2KB
ICSqlite3.h 2KB
ICSqlite3.h 2KB
ICStorage.h 2KB
ICStorage.h 2KB
ICStorage.h 2KB
ICUtility.h 2KB
ICUtility.h 2KB
ICUtility.h 2KB
NSArrayAdditions.h 2KB
NSArrayAdditions.h 2KB
NSArrayAdditions.h 2KB
NSDataAdditions.h 2KB
NSDataAdditions.h 2KB
NSDataAdditions.h 2KB
ICCache.h 2KB
ICCache.h 2KB
ICCache.h 2KB
NSDictionaryAdditions.h 2KB
NSDictionaryAdditions.h 2KB
NSDictionaryAdditions.h 2KB
ICIconv.h 2KB
ICIconv.h 2KB
ICIconv.h 2KB
NSURLAdditions.h 2KB
NSURLAdditions.h 2KB
NSURLAdditions.h 2KB
ICHTTPRequest.h 2KB
ICHTTPRequest.h 2KB
ICHTTPRequest.h 2KB
NSStringAdditions.h 1KB
NSStringAdditions.h 1KB
NSStringAdditions.h 1KB
ICCacheStorage.h 1KB
ICCacheStorage.h 1KB
ICCacheStorage.h 1KB
ICPreference.h 1KB
ICPreference.h 1KB
ICPreference.h 1KB
ICCacheRequest.h 1KB
ICCacheRequest.h 1KB
ICCacheRequest.h 1KB
NSPathUtilitiesAddtions.h 1KB
NSPathUtilitiesAddtions.h 1KB
NSPathUtilitiesAddtions.h 1KB
IdealAdditions.h 1KB
IdealAdditions.h 1KB
IdealAdditions.h 1KB
NSTimerAdditions.h 1KB
NSTimerAdditions.h 1KB
NSTimerAdditions.h 1KB
NSNumberFormatterAdditions.h 1KB
NSNumberFormatterAdditions.h 1KB
NSNumberFormatterAdditions.h 1KB
ICCrypto.h 1KB
ICCrypto.h 1KB
ICCrypto.h 1KB
IdealCocoa.h 1KB
IdealCocoa.h 1KB
IdealCocoa.h 1KB
NSBundleAdditions.h 1KB
NSBundleAdditions.h 1KB
NSBundleAdditions.h 1KB
NSDateAdditions.h 900B
NSDateAdditions.h 900B
NSDateAdditions.h 900B
Icon.icns 81KB
IdealCocoa 255KB
IdealCocoa 255KB
IdealCocoa 255KB
README.md 44KB
CHANGELOG.md 38KB
embedded.mobileprovision 7KB
VJDocument.mom 1KB
MainMenu.nib 26KB
VJDocument.nib 20KB
VJDocument.omo 2KB
PkgInfo 8B
Info.plist 2KB
Info.plist 1KB
Info.plist 1KB
Info.plist 1KB
VersionInfo.plist 467B
receipt 5KB
Credits.rtf 436B
共 105 条
- 1
- 2
资源评论
- dwn123452018-12-18很全面,很好用,谢谢分享.
YZ815
- 粉丝: 3
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功