serpyco-rs icon indicating copy to clipboard operation
serpyco-rs copied to clipboard

Feature request - Add json dump support directly from dataclasses

Open misrasaurabh1 opened this issue 5 months ago • 5 comments

Hi,

We have a performance critical section of code that looks like orjson.dumps(CustomSerializer.dump(message)).decode() The serializer uses serpyco-rs to dump to python object, which is then used by orjson to dump to string.

This part can get much faster if the serializer has an option to create a json directly without involving creating the python object as an intermediary and then jsonifying it.

What do you think about directly creating a serialized json from a dataclass? I can see this being a big usecase for a lot of people.

misrasaurabh1 avatar Sep 09 '24 01:09 misrasaurabh1