简体   繁体   English

如何使大型复杂JSON的解析速度更快?

[英]How to make parsing faster for large and complex JSON?

I want to parse a large JSON. 我想解析一个大的JSON。 How can I make it faster? 我怎样才能使其更快? Now it takes a lot of time. 现在需要很多时间。 Please help me. 请帮我。

you can use some wrappers like http://code.google.com/p/json-simple/ it is optimised to handle large data from json and easy to use. 您可以使用一些包装器,例如http://code.google.com/p/json-simple/,该包装器经过优化可处理json中的大数据,并且易于使用。

Also you can give it try to http://code.google.com/p/json-simple/ for better performance. 您也可以尝试通过http://code.google.com/p/json-simple/获得更好的性能。

Following are the others. 以下是其他。

You can check comparison article over here . 您可以在此处查看比较文章。

根据一些基准,杰克逊是最快的。

Use jackson JSON processor http://jackson.codehaus.org/ Most of the time people end up parsing the whole JSON and ignoring most of the data. 使用jackson JSON处理器http://jackson.codehaus.org/大多数情况下,人们最终都会解析整个JSON并忽略大部分数据。 This makes the process slow. 这会使过程变慢。 If you are going to discard a lot of data, parsing in SAX mode is much faster, since you can stop parsing as soon as you have found all the required data. 如果您要丢弃大量数据,则在SAX模式下进行分析要快得多,因为一旦找到所有必需的数据,您就可以停止分析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM