Opened 13 months ago
Closed 13 months ago
#35237 closed Cleanup/optimization (fixed)
Optimize system checks for admin actions
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 , 13 months ago
Has patch: | set |
---|---|
Owner: | changed from | to
Summary: | Improve → Optimize system checks for admin actions |
comment:2 by , 13 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 13 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:4 by , 13 months ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In 98e6f23: