python - Improving pagination and serialization time in django rest framework -


i using listapiview render list of objects. response returns paginated results limit=50. queryset size varies 0 few hundred thousands.

what have noticed when queryset size small, api response time small. queryset size increases, api response time becomes large.

is pagination culprit here?
there way optimize response time listapiviews using pagination?

as stated in official django documentation, querysets lazy.

querysets lazy – act of creating queryset doesn’t involve database activity. can stack filters day long, , django won’t run query until queryset evaluated.

also, pagination compliments queryset's laziness.

therefore, culprit delay not pagination.
case closed...


but then?

what faster?


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -