jschema-to-python icon indicating copy to clipboard operation
jschema-to-python copied to clipboard

Why deepcopy __dict__ to serialize to json?

Open melsabagh opened this issue 2 years ago • 0 comments

The deepcopy of the instance __dict__ during serialization at the following line seems unnecessary: https://github.com/microsoft/jschema-to-python/blob/c4fb418bd537fd78c52f1a193219fff6bf8af980/jschema_to_python/to_json.py#L26

I have benchmarked this and it is also a serious bottleneck when serializing large objects. Is there a reason behind creating a deep copy here instead of a shallow copy?

melsabagh avatar Oct 09 '22 20:10 melsabagh