- 授权协议: MIT
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/mailru/easyjson
- 软件文档: https://github.com/mailru/easyjson.git
- 官方下载: https://github.com/mailru/easyjson.git
软件介绍
Easyjson用于序列化JSON数据,采用Go语言编写,而不是通过使用反射生成编组代码。一个库的目的之一是使所生成的代码足够简单,使得它可以容易地优化或固定。另一个目标是为用户提供不可定制的“encoding/json”,如产生snake_case名称或启用默认“omitempty“生成代码。
用法:
go get github.com/mailru/easyjson/... easyjson -all <file>.go
这将利用编组/解组方法结构生成<file>_easyjson.go。
限制:
The library is at an early stage, there are likely to be some bugs and some features of 'encoding/json' may not be supported. Please report such cases, so that they may be fixed sooner.
Unsafe package is used by the code. While a non-unsafe version of easyjson can be made in the future, using unsafe package simplifies a lot of code by allowing to use 'switch' for filling out structs and working around limitations of standard functions like 'strconv.ParseInt'.
Floats are currently formatted with default precision for 'strconv' package. It is obvious that it is not always the correct way to handle it, but there aren't enough use-cases for floats at hand to do anything better.
During parsing, parts of JSON that are skipped over are not syntactically validated more than required to skip matching parentheses.
No true streaming support for encoding/decoding. For many use-cases and protocols, data length is typically known on input and needs to be known before sending the data.
解析:
| lib | json size | MB/s | allocs/op | B/op |
|---|---|---|---|---|
| standard | regular | 22 | 218 | 10229 |
| standard | small | 9.7 | 14 | 720 |
| -------- | ----------- | ------ | ----------- | ------- |
| easyjson | regular | 125 | 128 | 9794 |
| easyjson | small | 67 | 3 | 128 |
| -------- | ----------- | ------ | ----------- | ------- |
| ffjson | regular | 66 | 141 | 9985 |
| ffjson | small | 17.6 | 10 | 488 |
| -------- | ----------- | ------ | ----------- | ------- |
| codec | regular | 55 | 434 | 19299 |
| codec | small | 29 | 7 | 336 |
| -------- | ----------- | ------ | ----------- | ------- |
| ujson | regular | 103 | N/A | N/A |
编组,one goroutine
| lib | json size | MB/s | allocs/op | B/op |
|---|---|---|---|---|
| standard | regular | 75 | 9 | 23256 |
| standard | small | 32 | 3 | 328 |
| standard | large | 80 | 17 | 1.2M |
| ---------- | ----------- | ------ | ----------- | ------- |
| easyjson | regular | 213 | 9 | 10260 |
| easyjson* | regular | 263 | 8 | 742 |
| easyjson | small | 125 | 1 | 128 |
| easyjson | large | 212 | 33 | 490k |
| easyjson* | large | 262 | 25 | 2879 |
| ---------- | ----------- | ------ | ----------- | ------- |
| ffjson | regular | 122 | 153 | 21340 |
| ffjson** | regular | 146 | 152 | 4897 |
| ffjson | small | 36 | 5 | 384 |
| ffjson** | small | 64 | 4 | 128 |
| ffjson | large | 134 | 7317 | 818k |
| ffjson** | large | 125 | 7320 | 827k |
| ---------- | ----------- | ------ | ----------- | ------- |
| codec | regular | 80 | 17 | 33601 |
| codec*** | regular | 108 | 9 | 1153 |
| codec | small | 42 | 3 | 304 |
| codec*** | small | 56 | 1 | 48 |
| codec | large | 73 | 483 | 2.5M |
| codec*** | large | 103 | 451 | 66007 |
| ---------- | ----------- | ------ | ----------- | ------- |
| ujson | regular | 92 | N/A | N/A |
编组,并发
| lib | json size | MB/s | allocs/op | B/op |
|---|---|---|---|---|
| standard | regular | 252 | 9 | 23257 |
| standard | small | 124 | 3 | 328 |
| standard | large | 289 | 17 | 1.2M |
| ---------- | ----------- | ------- | ----------- | ------- |
| easyjson | regular | 792 | 9 | 10597 |
| easyjson* | regular | 1748 | 8 | 779 |
| easyjson | small | 333 | 1 | 128 |
| easyjson | large | 718 | 36 | 548k |
| easyjson* | large | 2134 | 25 | 4957 |
| ---------- | ----------- | ------ | ----------- | ------- |
| ffjson | regular | 301 | 153 | 21629 |
| ffjson** | regular | 707 | 152 | 5148 |
| ffjson | small | 62 | 5 | 384 |
| ffjson** | small | 282 | 4 | 128 |
| ffjson | large | 438 | 7330 | 1.0M |
| ffjson** | large | 131 | 7319 | 820k |
| ---------- | ----------- | ------ | ----------- | ------- |
| codec | regular | 183 | 17 | 33603 |
| codec*** | regular | 671 | 9 | 1157 |
| codec | small | 147 | 3 | 304 |
| codec*** | small | 299 | 1 | 48 |
| codec | large | 190 | 483 | 2.5M |
| codec*** | large | 752 | 451 | 77574 |
Web协议与实践
克里希纳穆尔蒂 (KrishnamurthyBalachander) / 范群波 / 科学出版社 / 2003-7 / 46.0
本书全面论述了传输Web内容的系统和协议,重点讲述了Web中业已成熟和稳定的技术,如TCP/IP协议及DNS技术、HITP/1.0的设计及其与TCP之间的交互;深入阐述了Web高速缓存技术和多媒体流播技术的最新技术动态;分析了Apache Web服务器和Squid代理;还探讨了通信量的分析和测量技术。书中使用了大量示例、技术发展水平报告以及案例分析来阐述Web的工作原理和各个组件之间的交互。本书是......一起来看看 《Web协议与实践》 这本书的介绍吧!
URL 编码/解码
URL 编码/解码
RGB HSV 转换
RGB HSV 互转工具
