Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#9032 closed enhancement (fixed)

[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: Branch:
Release Notes:
API Changes:
Internal 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 (1)

perm.py-caching.diff (1.6 KB ) - added by Örjan Persson <orange@…> 14 years ago.
PermissionSystem.get_users_with_permission caching

Download all attachments as: .zip

Change History (6)

by Örjan Persson <orange@…>, 14 years ago

Attachment: perm.py-caching.diff added

PermissionSystem.get_users_with_permission caching

comment:1 by Christian Boos, 14 years ago

Keywords: permission performance consider added
Milestone: 0.11.7

How costly in memory is this?

comment:2 by Örjan Persson <orange@…>, 14 years ago

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 by Christian Boos, 14 years ago

Patch applied in r9203 (stable) and r9204 (trunk), thanks!

comment:4 by Christian Boos, 14 years ago

Owner: set to Örjan Persson <orange@…>

comment:5 by Christian Boos, 14 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Örjan Persson <orange@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Örjan Persson <orange@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.