Opened 8 years ago

Closed 5 years ago

#9102 closed Cleanup/optimization (duplicate)

admin Filter Box redraws each time it's changed

Reported by: David Cramer Owned by: David Cramer
Component: contrib.admin Version: 1.0
Severity: Normal Keywords: admin
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The filter box in django.contrib.admin redraws itself completely anytime its filtered, added from, or removed from. This causes severe slowdowns when there are a lot of items being displayed.

Attachments (1)

efficient-filters.diff (6.3 KB) - added by David Cramer 8 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 8 years ago by David Cramer

I should have a patch for this tonight. I've changed the select box code to work as follows:

  • The "cache" is just a key/ref pointer for option.value->option.
  • Each filter box contains a full list of every option.
  • Options are shown/hidden if based on if they're active.

comment:2 Changed 8 years ago by David Cramer

Summary: admin Filter Box redraws each it's changedadmin Filter Box redraws each time it's changed

comment:3 Changed 8 years ago by Adrian Holovaty

Triage Stage: UnreviewedAccepted

Good improvement. I look forward to the patch!

comment:4 Changed 8 years ago by Adrian Holovaty

Component: Contrib appsdjango.contrib.admin

comment:5 Changed 8 years ago by David Cramer

Owner: changed from nobody to David Cramer
Status: newassigned

Changed 8 years ago by David Cramer

Attachment: efficient-filters.diff added

comment:6 Changed 8 years ago by David Cramer

I removed the sort method (it's complicated to convert) because it was not in use anymore. If this is an issue I'll write a new sort method.

comment:7 Changed 8 years ago by David Cramer

Has patch: set

comment:8 Changed 8 years ago by David Cramer

The patch above is not fully working. It's just the JavaScript optimizations. I'll submit a full patch tonight.

comment:9 Changed 6 years ago by Matthias Kestenholz

Related ticket: #3202[patch] Faster SelectBox for ManyToMany

The patch on this ticket looks more thorough, but it does not seem to be worked on anymore?

comment:10 Changed 6 years ago by Luke Plant

Severity: Normal
Type: Cleanup/optimization

comment:11 Changed 5 years ago by Julien Phalip

Easy pickings: unset
Resolution: duplicate
Status: assignedclosed
UI/UX: unset

Yes, this is essentially a duplicate of #3202.

Note: See TracTickets for help on using tickets.
Back to Top