Live data from Hacker News

Json vs. simplejson vs. ujson

jyotiska.github.io

31–40 of 75 posts

Re: Json vs. simplejson vs. ujson

#31
post #21

Earlier quoted context omitted.

Check out intern(): https://docs.python.org/2/library/functions.html#intern

Appears to be deprecated though.

Not really, it was just moved to the sys module: https://docs.python.org/3.4/library/sys.html#sys.intern

Re: Json vs. simplejson vs. ujson

#32
But ujson comes at a price of slightly reduced functionality. For example, you cannot set indent. (And I typically set indent for files (BTW: I got tempted to try ujson exactly for the original blog post, i.e. http://blog.dataweave.in/post/87589606893/json-vs-simplejson...)

Plus, AFAIK, at least in Python 3 json IS simplejson (but a few version older). So every comparison of these libraries is going to give different results over time (likely, with difference getting smaller). Of course, simpejson is the newer thing of the same, so it's likely to be better.

Re: Json vs. simplejson vs. ujson

#35

I just want to add another library in here which – at least in my world – is replacing json as the number one configuration and serialisation format. It's called libucl and it's main consumer is probably the new package tool in FreeBSD: `pkg` Its syntax is nginx-like but can also parse strict json. It's pretty fast too. More info here: https://github.com/vstakhov/libucl

At one point I looked into using it, but there werent any python bindings at the time, and I didnt have the time (for the project) to write any. Are there any good language libs for it these days?

Conveniently enough the first python extension landed in head 10 days ago: https://github.com/vstakhov/libucl/pull/68

Re: Json vs. simplejson vs. ujson

#37
> ultrajson ... will not work for un-serializable collections

So I can't serialize things with ultrajson that aren't serializable? I must be missing something in this statement.

> The verdict is pretty clear. Use simplejson instead of stock json in any case...

The verdict seems clear (based solely on the data in the post) that ultrajson is the winner.

Re: Json vs. simplejson vs. ujson

#38
> ultrajson ... will not work for un-serializable collections

So I can't serialize things with ultrajson that aren't serializable? I must be missing something in this statement.

> The verdict is pretty clear. Use simplejson instead of stock json in any case...

The verdict seems clear (based solely on the data in the post) that ultrajson is the winner.

Re: Json vs. simplejson vs. ujson

#39

I just want to add another library in here which – at least in my world – is replacing json as the number one configuration and serialisation format. It's called libucl and it's main consumer is probably the new package tool in FreeBSD: `pkg` Its syntax is nginx-like but can also parse strict json. It's pretty fast too. More info here: https://github.com/vstakhov/libucl

Out of curiousity, what do you mean by "my world"? Is this a particular domain you're working in, or just your personal usage?
Post reply on HN