Re: [openstack-dev] [all] ujson "drop in" replacement

2017-11-01 Thread gordon chung


On 01/11/17 03:00 PM, Graham Hayes wrote:
> There seems to be a lot of "replace oslo.serization / native python json
> with UltraJSON (otherwise known as ujson) patches over the last few
> weeks.
>
> We should be careful - it is not a drop in replacement. e.g. -

rofl. i guess someone took our patch and ran with it.

for the record, we don't have an api in ceilometer and we also bench'd 
the performance when we originally adopted in gnocchi[1] (spoiler: it's 
much faster). but yeah, it dumps differently in some cases.

[1] https://review.openstack.org/#/c/386744

cheers,

-- 
gord
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [all] ujson "drop in" replacement

2017-11-01 Thread Graham Hayes
Hey all,

There seems to be a lot of "replace oslo.serization / native python json
with UltraJSON (otherwise known as ujson) patches over the last few
weeks.

We should be careful - it is not a drop in replacement. e.g. -

Normal python JSON:

>>> import json
>>> json.dumps({"url":"https://google.com"})
'{"url": "https://google.com"}'

ujson:

>>> import ujson as json
>>> json.dumps({"url":"https://google.com"})
'{"url":"https:\\/\\/google.com"}'

It is not currently in use in many projects:

curl -X POST http://codesearch.openstack.org/api/v1/search -F
q=ujson -F repos='*' -F files="requirements\.txt" -f  -s | jq '.Results
| keys'
[
  "ceilometer",
  "kiloeyes",
  "monasca-common",
  "requirements",
  "rpm-packaging"
]

I personally do not see the point in adding another dependency that has
weird behaviour for an as yet unmeasured performance increase.

- Graham



signature.asc
Description: OpenPGP digital signature
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev