Ticket #9032 (closed enhancement: fixed)
Opened 2 years ago
Last modified 2 years ago
[PATCH] Permission system slow with multiple calls
| Reported by: | Örjan Persson <orange@…> | Owned by: | Örjan Persson <orange@…> |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11.7 |
| Component: | general | Version: | 0.11.1 |
| Severity: | normal | Keywords: | permission performance consider |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
Trac slows down by time when used together with the privatetickets plugin. Not sure if this has any performance improvements on normal systems but hopefully it has.
For one report the rendering time went down from 43s to 5s. But the improvement is not limited to reports. This should affect all 0.11.x releases.
Attachments
Change History
Changed 2 years ago by Örjan Persson <orange@…>
- Attachment perm.py-caching.diff added
comment:1 Changed 2 years ago by cboos
- Keywords permission performance consider added
- Milestone set to 0.11.7
How costly in memory is this?
comment:2 Changed 2 years ago by Örjan Persson <orange@…>
That depends on the number of users. It's ACTION -> (timestamp, [users]). But in my test I only managed to trigger this call for TICKET_MODIFY. In that case it's ustring * users. I have a hard time seeing that it would be a problem since the data still need to be fetched from time to time.
If memory is an issue I suggest to try to re-use the same ustring object for all usernames, quick way would be to use intern() on them.
comment:3 Changed 2 years ago by cboos
comment:4 Changed 2 years ago by cboos
- Owner set to Örjan Persson <orange@…>
comment:5 Changed 2 years ago by cboos
- Resolution set to fixed
- Status changed from new to closed



PermissionSystem?.get_users_with_permission caching