Code

Opened 6 years ago

Closed 3 years ago

#9102 closed Cleanup/optimization (duplicate)

admin Filter Box redraws each time it's changed

Reported by: dcramer Owned by: dcramer
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 dcramer 6 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 6 years ago by dcramer

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 6 years ago by dcramer

  • Summary changed from admin Filter Box redraws each it's changed to admin Filter Box redraws each time it's changed

comment:3 Changed 6 years ago by adrian

  • Triage Stage changed from Unreviewed to Accepted

Good improvement. I look forward to the patch!

comment:4 Changed 6 years ago by adrian

  • Component changed from Contrib apps to django.contrib.admin

comment:5 Changed 6 years ago by dcramer

  • Owner changed from nobody to dcramer
  • Status changed from new to assigned

Changed 6 years ago by dcramer

comment:6 Changed 6 years ago by dcramer

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 6 years ago by dcramer

  • Has patch set

comment:8 Changed 6 years ago by dcramer

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

comment:9 Changed 4 years ago by mk

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 3 years ago by lukeplant

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:11 Changed 3 years ago by julien

  • Easy pickings unset
  • Resolution set to duplicate
  • Status changed from assigned to closed
  • UI/UX unset

Yes, this is essentially a duplicate of #3202.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.