Closed psrok1 closed 1 year ago
Serialization is splitted to Task.to_dict that is then used by Task.serialize
Task.to_dict
Task.serialize
It should be a bit more efficient than json.dumps(cls=...) and enables us to use orjson for serialization as well:
json.dumps(cls=...)
In [10]: timeit.timeit(lambda: karton.core.task.Task({}).serialize(), number=100000) Out[10]: 1.5992015590891242
vs
In [6]: timeit.timeit(lambda: karton.core.task.Task({}).serialize(), number=100000) Out[6]: 1.1377838689368218
closes #209
Serialization is splitted to
Task.to_dict
that is then used byTask.serialize
It should be a bit more efficient than
json.dumps(cls=...)
and enables us to use orjson for serialization as well:vs
closes #209