django icon indicating copy to clipboard operation
django copied to clipboard

Optimized ModelAdmin.changelist_view if actions are not used

Open blueyed opened this issue 7 years ago • 2 comments

This avoids calling len() on cl.result_list.

blueyed avatar Apr 28 '17 13:04 blueyed

Does it result in a meaningful performance improvement for your project? Considering the default list_per_page = 100 and the default delete action, I guess this won't help much for most users.

timgraham avatar May 31 '17 23:05 timgraham

@timgraham

Does it result in a meaningful performance improvement for your project?

Yes - I've not done this just for fun, but only after debugging it.. ;)

Considering the default list_per_page = 100 and the default delete action, I guess this won't help much for most users.

IIRC it was for a model/table with millions of rows etc - so while certainly something uncommon ("not for most users"), it is likely to make a (small) difference already with smaller tables.

Let me know if I should look into resolving conflicts here.

blueyed avatar Sep 17 '19 10:09 blueyed

I'm doing some PR housekeeping. I'll be closing this since I believe that the diff is too outdated to review it properly.

@blueyed if you want this PR to be re-reviewed, could you please rebase onto main and ping me so I re-open it? Please include a more explicit description about what problem is the removal of the len() call solving. Thanks!

nessita avatar Apr 18 '23 14:04 nessita