1. 首页
  2. 开源项目

gjson 快速获取 JSON 文档 gjson

xuanbao • 4131 次点击
这是一个分享于 的项目,其中的信息可能已经有所发展或是发生改变。
gjson 是一个 Go 开发 包,提供了非常快速和简单的方式来获得一个 JSON 文档 的值 。此文库的存在是为 BuntDB 项目提供高效的 JSON 索引。 ### 安装: 开始使用 GJSON,安装 Go ,并运行 go get: <pre class="brush:java;toolbar: true; auto-links: false;">$ go get -u github.com/tidwall/gjson</pre> 此操作可恢复文库。 ### 性能: 与 [encoding/json](https://golang.org/pkg/encoding/json/) , [ffjson](https://github.com/pquerna/ffjson) , [EasyJSON](https://github.com/mailru/easyjson) , 和 [jsonparser](https://github.com/buger/jsonparser) 并列的 GJSON 基准点。 <pre box-sizing:="" font-family:="" liberation="" font-size:="" margin-top:="" margin-bottom:="" font-stretch:="" line-height:="" word-wrap:="" padding:="" overflow:="" background-color:="" border-radius:="" color:="">BenchmarkGJSONGet-8 15000000 333 ns/op 0 B/op 0 allocs/op BenchmarkGJSONUnmarshalMap-8 900000 4188 ns/op 1920 B/op 26 allocs/op BenchmarkJSONUnmarshalMap-8 600000 8908 ns/op 3048 B/op 69 allocs/op BenchmarkJSONUnmarshalStruct-8 600000 9026 ns/op 1832 B/op 69 allocs/op BenchmarkJSONDecoder-8 300000 14339 ns/op 4224 B/op 184 allocs/op BenchmarkFFJSONLexer-8 1500000 3156 ns/op 896 B/op 8 allocs/op BenchmarkEasyJSONLexer-8 3000000 938 ns/op 613 B/op 6 allocs/op BenchmarkJSONParserGet-8 3000000 442 ns/op 21 B/op 0 allocs/op</pre> JSON 文档使用: <pre class="brush:java;toolbar: true; auto-links: false;">{ &#34;widget&#34;: { &#34;debug&#34;: &#34;on&#34;, &#34;window&#34;: { &#34;title&#34;: &#34;Sample Konfabulator Widget&#34;, &#34;name&#34;: &#34;main_window&#34;, &#34;width&#34;: 500, &#34;height&#34;: 500 }, &#34;image&#34;: { &#34;src&#34;: &#34;Images/Sun.png&#34;, &#34;hOffset&#34;: 250, &#34;vOffset&#34;: 250, &#34;alignment&#34;: &#34;center&#34; }, &#34;text&#34;: { &#34;data&#34;: &#34;Click Here&#34;, &#34;size&#34;: 36, &#34;&#34;: &#34;bold&#34;, &#34;vOffset&#34;: 100, &#34;alignment&#34;: &#34;center&#34;, &#34;onMouseUp&#34;: &#34;sun1.opacity = (sun1.opacity / 100) * 90;&#34; } } }</pre> 每个操作都 是通过下面的搜索路径之一回转: <pre class="brush:java;toolbar: true; auto-links: false;">widget.window.name widget.image.hOffset widget.text.onMouseU</pre>
授权协议:
MIT
开发语言:
Google Go 查看源码»
操作系统:
跨平台
4131 次点击
暂无回复
添加一条新回复 (您需要 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传

用户登录

没有账号?注册
(追記) (追記ここまで)

今日阅读排行

    加载中

一周阅读排行

    加载中