当前位置:网站首页>Fastjon2 here he is, the performance is significantly improved, and he can fight for another ten years
Fastjon2 here he is, the performance is significantly improved, and he can fight for another ten years
2022-06-09 21:03:00 【51CTO】
Fastjon2 Here he comes , Significantly improved performance , Another ten years
- summary
- Use
- Fastjson2 relative fastjson1 Performance improvement
summary
The official definition given by Ali is ,FASTJSON It's Alibaba's open source JSON Parsing library , It can parse JSON Format string , Support will Java Bean Serialize to JSON character string , You can also get it from JSON Deserialize string to JavaBean.
FASTJSON Relative to others JSON The characteristic of the library is fast , from 2011 year fastjson Release 1.1.x After the version , Its performance has never been other Java Realized JSON Kuroshio .
FASTJSON 2.0 yes FASTJSON Important upgrade of the project , The goal is to provide a high-performance platform for the next decade JSON library , The same set of API Support JSON/JSONB Two protocols ,JSONPath First class citizen , Support full resolution and partial resolution , Support Java Server side 、 client Android、 Big data scenario .
Use
introduce Maven rely on
stay FASTJSON 2.0 in ,groupId and 1.x Dissimilarity , yes com.alibaba.fastjson2
https://repo1.maven.org/maven2/com/alibaba/fastjson2/fastjson2/
2.0 Previous FASTJSON Coordinates are as follows , The latest version is 1.2.79:
https://github.com/alibaba/fastjson/releases
Official statement : If you used fastjson 1.2.x edition , Compatible packages can be used , Compatibility packages do not guarantee 100% compatible , Please test carefully to verify , If you find any problems, please give feedback in time . The compatible package coordinates are as follows :
Common classes and methods
stay fastjson 2.0 in ,package and 1.x Dissimilarity , yes com.alibaba.fastjson2. If you used fastjson1, In most cases, just change the package name directly .
Common cases
String rotation JSON object /JSON Array
object :
Array objects :
JavaBean Object turn JSON Format string
Output is as follows :
JSON Format string to JavaBean object
Output is as follows :
JSON Format string to JavaBean An array of objects
Output is as follows :
Fastjson2 relative fastjson1 Performance improvement
Compare versions
- Fastjson 2.0.1
- Fastjson 1.2.79
- Jackson 2.12.4
Parse Performance comparison
Test code
Scene introduction and conclusion
- EishayParseTreeString scene , take String It can be interpreted as JSONObject/JSONArray perhaps HashMap/ArrayList. In this scene ,fastjson2 Show twice as much as fastjson1 Performance of
- EishayParseString scene , take String Deserialize to JavaBean object , In this scene fastjson2 be relative to fastjson1 Improved performance 30% Performance of .
- EishayParseStringPretty, Format with spaces and line breaks indented String Deserialize to JavaBean object ,fastjson2 stay 3.44 Twice as much as fastjson1. The scene is fastjson1 Middle is weak , stay fastjson2 A new analytical algorithm is used in , The performance has been greatly improved .
- EishayParseUTF8Bytes, take UTF8 Format byte[] Deserialize to JavaBean object .
WriteString
Test code
Scene introduction and conclusion
- EishayWriteString scene , take JavaBean Objects are serialized as strings . In this scenario ,fastjson2 Than fastjson1 and jackson There were 164% and 85% Performance improvement of
- EishayWriteUTF8Bytes scene , take JavaBean Object serialization to UTF8 Format byte Array . In this scenario ,fastjson2 Than fastjson1 and jackson There were 185% and 93% Performance improvement of
source :
https://github.com/alibaba/fastjson/releases
https://github.com/alibaba/fastjson2/releases/tag/2.0.1
https://github.com/alibaba/fastjson2/wiki/fastjson_benchmark
边栏推荐
- Who says redis can't save big keys
- [cf] 797 div3 E. Price Maximization
- Application of anonymous function in C #
- Kubevirt network source code analysis (3) - virtual machine hot migration network
- KubeVirt网络源码分析(3)- 虚拟机热迁移网络
- CompareTo和compare的区别
- Dataframe merge
- About C unity read / write file
- Heap (priority queue)
- Analysis of source code data anti leakage solution
猜你喜欢

线性回归总结

Go installation tutorial

Latex mathematical symbols Encyclopedia

实例:用C#.NET手把手教你做微信公众号开发(19)--使用微信支付转账到微信粉丝零钱账户

Cvpr2022 oral | cross view transformer for semantic segmentation of real-time map views

Just learning embedded, I want to ask what is interrupt and what is the concept of interrupt

Le navigateur ne peut pas ouvrir Baidu, d'autres peuvent être ouverts normalement

Es automatic stop

(I) apple has open source, but so what?

多线程场景下使用 ArrayList 丢数据
随机推荐
Dataframe merge
Gbase8s database select Clause 6
Perfect number (arithmetic borrow problem)
The role of partial in C #
Lambda Exception
区间值(单调栈)
Force buckle 84- the largest rectangle in the histogram (monotone stack)
瀏覽器無法打開百度,別的可以正常打開
完美数(算数借位问题)
Internal volume of Dachang series "line segment tree - meeting room problem"
Kubevirt network source code analysis (3) - virtual machine hot migration network
Some problems encountered in deploying cinder CSI plugin
Integer ordered array lookup -- traversal and half / bisection
Typescript variable declaration
Ndarry sorting in numpy
Fanwei oa8 foreground SQL injection
做副业赚钱,这几个热门自媒体平台收益超多
[operation and maintenance department] ad domain file permission management
Application of anonymous function in C #
739. 每日温度 - 力扣(单调递减栈)