Erlang JSON库:序列化性能? [英] Erlang JSON libraries: serialization performance?

查看:118
本文介绍了Erlang JSON库:序列化性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有许多可用于Erlang的JSON库,对我来说,具有最佳性能特征(其次是易用性)并不清楚,特别是对于erlang-to-json序列化。

There are a number of JSON libraries available for Erlang, and it's not clear to me which have the best performance characteristics (and, secondarily, ease of use), especially for erlang-to-json serialization.

我的用例需要JSON解析和序列化,但是Erlang代码可能会产生比接收输入更多的JSON输出(即序列化)至少两个数量级。

My use case requires both JSON parsing and serialization, but the Erlang code will probably be producing at least two orders of magnitude more JSON output (i.e. serialization) than it will receive input.

为了参考,我知道的图书馆包括以下(可能还有其他我还没有找到):

For reference, the libraries I know of include the following (and there may be others I haven't found):

  • mochijson
  • mochijson2
  • erlang-rfc4627
  • eep0018

推荐答案

a href =http://hg.opensource.lshift.net/erlang-rfc4627/file/32055dd1b348/src/rfc4627.erl =nofollow noreferrer> rfc4627.erl (我偶然发现,性能不是一个问题)

I use rfc4627.erl (I stumbled upon it, and performance has not been an issue)

但是,我期望不同的本地erlang库执行得很好。他们分享想法(如代码评论中所见)。 AFAIK mochijson rfc4627 共享相同的源erlang格式。

However, I do expect the different native erlang libraries to perform similarly well. They share ideas (as witnessed in the code comments). AFAIK mochijson and rfc4627 share the same source erlang format.

eep018 是C,正在努力实施... hrm ... eep-0018 term_to_json 可能包含在Erlang未来版本中的本机编码器。从来没有尝试过,似乎并没有保持下去。

eep018 is C, and as it is striving to implement ... hrm ... eep-0018, the term_to_json native encoder that might be included in a future version of Erlang. Never tried it and doesn't seem actively maintained.

我的最终建议是与 mochiweb的mochijson(2)。 >事实上标准,并被CouchDB和Facebook等使用。

My final recommendation is go with mochiweb's mochijson(2). It is the de facto standard and actively maintained, used by, among others, CouchDB and Facebook.

至于在 mochijson mochijson2 可能会帮助你。

As for choosing between mochijson and mochijson2, this might help you.

这篇关于Erlang JSON库:序列化性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆