Opened 21 months ago
Closed 21 months ago
#35237 closed Cleanup/optimization (fixed)
Optimize system checks for admin actions
| Reported by: | Adam Johnson | Owned by: | Adam Johnson |
|---|---|---|---|
| Component: | Core (System checks) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
In ModelAdminChecks, the _check_action_permission_methods and _check_actions_uniqueness both fetch the actions. By combining them, this duplicate work can be eliminated.
Additionally, the lower method ModelAdmin._get_action_description() is wasteful as it computes a default name even when one is defined. This can be deferred and cached.
In a project I’ve profiled, these changes take the admin action checks from 0.86ms (2.1%) to 0.36ms (0.9%).
Change History (4)
comment:1 by , 21 months ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Summary: | Improve → Optimize system checks for admin actions |
comment:2 by , 21 months ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 21 months ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:4 by , 21 months ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In 98e6f23: