Opened 53 minutes ago
Last modified 49 minutes ago
#37163 assigned Cleanup/optimization
Optimize `@user_passes_test`
| Reported by: | Adam Johnson | Owned by: | Adam Johnson |
|---|---|---|---|
| Component: | contrib.auth | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
#35030 added async support to this decorator, but put the async test and wrapping for test_func at call time. This work can instead be done once at decoration time, saving ~500 ns per request.
Note:
See TracTickets
for help on using tickets.