@HenryBao91 As work-around you can use jsoniter-scala for that instead. It is one of the most efficient Scala parser which supports all kinds of Scala collections from the standard library and can be easily extended for a custom one.
@plokhotnyuk Thank you very much.I started with json4s, and then I learned that fastjson has very strong performance, much higher than json4s, so I started trying to use fastjson. So, is the jsoniter-scala you mentioned also a popular high-performance JSON format processing library?
@HenryBao91 I should have to put a disclaimer that I have contributed to jsoniter-scala a lot.
In my early Scala days 8 years ago I used json4s too, but now nobody cares to fix security issues for it.
The 1st version of jsoniter-scala was released ~1.5 year ago and now it is gaining popularity attracting users by handy usage, safety, and performance.
One of the key difference from other JSON libraries for Scala: almost all bugs were fixed with a subsequent release in a term of couple days after reporting.
Bellow are charts from the Maven Central statistics:
As far as I understand, fastjson mostly targeted on Java users and its maintainers can be interested to bring some performance tricks from jsoniter-scala to them. It can be faster parsing and serialization for floats and doubles primitives, BigInteger, BigDecimal, and java.time.* classes, etc.
@plokhotnyuk I'm really honored to have your detailed answer. I'm not particularly familiar with Scala because I've only been in touch with Scala for a short time. I do find that many examples of fastjson applications on the Internet are on java. Finally, thank you very much for your valuable help.
5条答案
按热度按时间tzdcorbm1#
@HenryBao91 As work-around you can use jsoniter-scala for that instead.
It is one of the most efficient Scala parser which supports all kinds of Scala collections from the standard library and can be easily extended for a custom one.
vohkndzv2#
@plokhotnyuk Thank you very much.I started with json4s, and then I learned that fastjson has very strong performance, much higher than json4s, so I started trying to use fastjson. So, is the jsoniter-scala you mentioned also a popular high-performance JSON format processing library?
ghhkc1vu3#
@HenryBao91 I should have to put a disclaimer that I have contributed to jsoniter-scala a lot.
In my early Scala days 8 years ago I used json4s too, but now nobody cares to fix security issues for it.
The 1st version of jsoniter-scala was released ~1.5 year ago and now it is gaining popularity attracting users by handy usage, safety, and performance.
One of the key difference from other JSON libraries for Scala: almost all bugs were fixed with a subsequent release in a term of couple days after reporting.
Bellow are charts from the Maven Central statistics:
As far as I understand, fastjson mostly targeted on Java users and its maintainers can be interested to bring some performance tricks from jsoniter-scala to them. It can be faster parsing and serialization for floats and doubles primitives,
BigInteger
,BigDecimal
, andjava.time.*
classes, etc.eni9jsuy4#
@plokhotnyuk I'm really honored to have your detailed answer. I'm not particularly familiar with Scala because I've only been in touch with Scala for a short time. I do find that many examples of fastjson applications on the Internet are on java. Finally, thank you very much for your valuable help.
pxyaymoc5#
可以考虑一下转为java.util.map然后用parse,自己估算一下对性能的压力