Closed Kub-AT closed 3 years ago
I haven't done any benchmarks, but I'd expect it to be slower. The main reason is that the serializer has to rediscover and recreate the fields every time it is created. We could cache some information to improve this a bit, but it is mainly a limitation in the design of DRF's serializers. DRF's ModelSerializer also suffers from this problem (see encode/django-rest-framework#7093).
If you're looking for high-performance (de)serialization, you might try Pydantic instead: https://pydantic-docs.helpmanual.io/benchmarks/
Hi,
How about performance ? Did you test large objects serialization performance ?
djangorestframework-dataclasses vs build-in drf serializer ?