blitzdb icon indicating copy to clipboard operation
blitzdb copied to clipboard

Support for ujson

Open celestianx opened this issue 8 years ago • 1 comments

Hi, ujson is recognized as a really fast json encoder/decoder, would it be possible to choose the json encoder/decoder library as part of arguments

celestianx avatar Feb 02 '17 18:02 celestianx

Hey @celestian02 , that should be easy to do! Do you want to make the change and open a PR?

You'd need to modify two files: https://github.com/adewes/blitzdb/blob/master/blitzdb/backends/file/serializers.py

Here you'd need to add a new serializer class that imports "ujson" instead of "json" (you can have a look at the CJsonSerializer class for an example)

https://github.com/adewes/blitzdb/blob/master/blitzdb/backends/file/backend.py

Here you'd just need to add 'ujson' to the list of serializers (again, you can have a look at the 'cjson' example).

Let me know if I can help you with anything!

adewes avatar Feb 02 '17 22:02 adewes