Edgewall Software
Modify

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

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

Download all attachments as: .zip

Change History

Changed 2 years ago by Örjan Persson <orange@…>

PermissionSystem?.get_users_with_permission caching

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

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

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
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from Örjan Persson <orange@…>. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.