dabapps / django-rest-framework-serialization-spec

DEPRECATED, see https://github.com/dabapps/django-readers instead
MIT License
11 stars 0 forks source link

PERFORMANCE: Replace prefetching and ModelSerializers with .values() and manual stitching #47

Open pmg103 opened 4 years ago

pmg103 commented 4 years ago

Some initial investigation seems to suggest that a speedup could be gained by ditching prefetch_related and select_related and ModelSerializer and building the response using .values_list() and .values() and manual stitching together the values.

Is this good enough that it would warrant losing the ability to call Model methods/properties?

Would also mean a complete rewrite of the implementation of course :D -- but probably also a simplification.

RealOrangeOne commented 4 years ago

10x speedup

:scream: