noisyboiler / wampy

Websocket RPC and Pub/Sub for Python applications and microservices
Mozilla Public License 2.0
127 stars 24 forks source link

ujson vs simplejson #46

Closed oddjobz closed 6 years ago

oddjobz commented 6 years ago

Hi, I don't know if you've considered this already, but I started using "ujson" instead of "json" a little while back, seems to be completely stable / reliable, and around 4x faster than "simplejson". If your app does a lot of WAMP type work, it can make a noticeable difference ..

https://github.com/esnme/ultrajson

noisyboiler commented 6 years ago

hiya @oddjobz yep, i briefly looked at it before. but thanks for reminding me. my problem is i need the separators=(',', ':') parameter that json or simplejson gives me. do you know how I would apply the same behaviour to ujson?

oddjobz commented 6 years ago

Never used 'separators' I'm afraid. I guess it depends on what you need it for. If it's just for removing white-space, personally I'll go with 4x the speed every time .. :)

titilambert commented 6 years ago

I already made used ujson for an other project. I can confirm, the speed is uncomparable..., Maybe we can try to support both, because ujson need some C compilation...

noisyboiler commented 6 years ago

I'll look into how wampy can use ujson instead.

noisyboiler commented 6 years ago

if it's uncomparable then there is no need for this. thanks though to all those who took an interest.