View Issue Details

IDProjectCategoryView StatusLast Update
0018016mantisbtperformancepublic2016-06-12 00:42
ReporterjhelfAssigned Tocproensa 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.18 
Target Version1.3.0-rc.2Fixed in Version1.3.0-rc.2 
Summary0018016: Decreasing performance when loading bug view with many notes

When being logged in with an administrator user and repeatedly loading a bug with many notes the response times get perceivably worse over time.

This is probably related to issue 0013680 and already explained by note 0013680:0031981 but there seems to be no overall fix.

Steps To Reproduce

Initial situation:

I installed the stable 1.2.18 release with an existing database. Upgrade procedure was performed as documented. I don't think its an issue with the current release though, seems to be a general problem.

Way to reproduce:

  • Ensure form_security_validation is on
  • Login with an administrator account or similar rights.
  • Navigate to an issue with many notes (Because of the user permissions one should see 3 buttons at every note)
  • Keep reloading the page and watch the request times increase
Additional Information

The note buttons are rendered by the function print_button. print_button calls form_security_field which calls form_security_token where security tokens are generated and stored into the session.

In bugnote_view_inc.php print_button is called without a $p_security_token argument which forces a new token to be generated by every call to print_button.

Every single token is stored into the session. The session grows and grows with every call to print_button and the (de)serialization CPU drain increases proportional.

Login/Logout "cures" the Problem because a new session is generated.

TagsNo tags attached.


related to 0020142 closedcommunity performance loading bug view with many attachments 




2015-01-14 11:16

developer   ~0042154

Many thanks for the bug report and the detailed analysis.

I'll investigate as time allows and see if a similar fix can be applied to bug view page.



2015-09-26 20:27

developer   ~0051541

Can confirm
In my system i have some issues with >100 notes !!
Exactly as described by jhelf.

Proposed PR:



2016-02-19 07:38

reporter   ~0052527

Last edited: 2016-02-19 18:49

View 2 revisions

I can confirm the same for issues with more than 300 notes (610 is the biggest).

@cproensa 's PR 656 is just greate (cherry-picked the first 3 commits).

[EDIT dregad] removed # in front of PR number

Related Changesets

MantisBT: master 63329426

2015-09-26 20:04:53


Committer: dregad Details Diff
Pre-generate form security tokens

Avoid performance issues in bug view page

Fixes 0018016
mod - bugnote_view_inc.php Diff File

MantisBT: master f3555c30

2015-09-27 15:03:04


Committer: dregad Details Diff
Create tokens for action buttons only if needed

Issue 0018016
mod - bugnote_view_inc.php Diff File

MantisBT: master 9e532d6b

2016-03-06 17:45:18


Committer: dregad Details Diff
Dont use serialization for Session variables

There is no need to serialize data inserted in $_SESSION, as php does it
at the end of script

This is a performance hit when a session key is used multiple times (eg:

Additionally, we use a new identifier for the session key (by adding a
version number to it). Since we changed the format of the stored data,
this will ignore older session data to avoid errors for users having
active sessions during the transition.

Fixes 0020142, 0018016

Signed-off-by: Damien Regad <>

Squashed original commits and reworded commit message
mod - core/session_api.php Diff File

Issue History

Date Modified Username Field Change
2015-01-14 08:50 jhelf New Issue
2015-01-14 11:16 dregad Status new => acknowledged
2015-01-14 11:16 dregad Note Added: 0042154
2015-09-26 20:27 cproensa Note Added: 0051541
2015-09-28 05:39 atrol Relationship added related to 0020142
2016-02-19 07:38 gthomas Note Added: 0052527
2016-02-19 18:49 dregad Note Edited: 0052527 View Revisions
2016-03-07 05:27 dregad Changeset attached => MantisBT master 63329426
2016-03-07 05:27 dregad Changeset attached => MantisBT master f3555c30
2016-03-07 05:27 dregad Assigned To => dregad
2016-03-07 05:27 dregad Status acknowledged => resolved
2016-03-07 05:27 dregad Resolution open => fixed
2016-03-07 05:27 dregad Fixed in Version => 1.3.0-rc.2
2016-03-07 05:29 dregad Assigned To dregad => cproensa
2016-03-07 05:29 dregad Target Version => 1.3.0-rc.2
2016-05-14 12:45 dregad Changeset attached => MantisBT master 9e532d6b
2016-06-12 00:42 vboctor Status resolved => closed