← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:gitrepo-pending-merges-tuning into launchpad:master

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:gitrepo-pending-merges-tuning into launchpad:master.

Commit message:
Small improvements in performance and allowing to limit the amount of MPs displayed on repository-pending-merges portlet (on git repository page)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/377393

This is not exactly ready to be merged, but I would like some opinions.
I've checked with @profilehooks.profile some methods, and took a look on what could be improved for the repository-pending-merges portlet.

There are two places spending quite a lot of processing time:
1- Fetching and counting MPs to show  the /+activereivews link
This part fetches all MPs (and they can be a lot) just to count. It cannot be done on the database directly because we need to use Zope to check for permissions. I'm proposing to limit this count to a certain number, and after that just show "more than <limit> MPs" to the user.

2- List the summary of the most recent MPs for each branch
Again, this cannot be totally filtered on the database because of Zope's permission check. But, apart from limiting, I'm proposing some small improvements on the method getting the latest MP per branch.

On the test side, while I was coding the changes, I've wrote a small test to check the processing time. I'm including a slightly different version of what I've writen before, but I'm not sure if we should include this type of check based on the processing time. Specially because this is dependent on the machine running and it might eventually break under unexpected situations (think of a busy buildbot, for example). 

Anyway, I'll probably need to polish a bit this MP, but I would like to have some early feedback on it.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:gitrepo-pending-merges-tuning into launchpad:master.


Follow ups