Merge lp://staging/~jtv/launchpad/bug-711077 into lp://staging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Jeroen T. Vermeulen | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12368 | ||||
Proposed branch: | lp://staging/~jtv/launchpad/bug-711077 | ||||
Merge into: | lp://staging/launchpad | ||||
Diff against target: |
667 lines (+299/-120) 12 files modified
lib/lp/app/browser/configure.zcml (+6/-0) lib/lp/app/browser/tales.py (+19/-0) lib/lp/bugs/interfaces/bugbranch.py (+9/-5) lib/lp/bugs/model/bugbranch.py (+44/-34) lib/lp/bugs/tests/test_bugbranch.py (+89/-32) lib/lp/code/browser/branchlisting.py (+19/-11) lib/lp/code/browser/tests/test_revisionauthor.py (+82/-0) lib/lp/code/interfaces/revision.py (+3/-0) lib/lp/code/model/revision.py (+4/-3) lib/lp/code/model/tests/test_revision.py (+1/-1) lib/lp/code/templates/branch-listing.pt (+13/-30) lib/lp/registry/model/person.py (+10/-4) |
||||
To merge this branch: | bzr merge lp://staging/~jtv/launchpad/bug-711077 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
j.c.sackett (community) | code* | Approve | |
Review via email:
|
Commit message
[r=jcsackett,
Description of the change
= Summary =
Some +code-index indexes were timing out.
There were several main culprits:
* Code to figure out whether a branch is attached to bugs was too roundabout.
* Following references between objects can be costly even from cache.
* Authors' names and icons were retrieved one icon at a time.
* Complex tooltips with last-revision author info were constructed in TAL.
* Counting and querying merge proposals is complex, costly, and duplicative.
* ValidPersonCache is now a view, and hard to cache.
== Proposed fix ==
I addressed most of the issues I found, just not the last two ones: branch merge proposals and ValidPersonCache. It might help if we could get rid of the ValidPersonCache view in the schema at some point.
Fixes:
* A new getBranchesWith
* Many references can be bypassed using foreign keys' numeric values.
* A new fetchAuthorsFor
* A new link formatter renders RevisionAuthor links directly in python.
== Pre-implementation notes ==
Robert felt that GIL issues might be behind the problem, so I had a profile taken. I was unable to make much of the results though, and so focused on conventional optimization.
== Implementation details ==
Tests for getBranchesWith
== Tests ==
I ran all non-Windmill code tests plus test_bugbranch, and have a full EC2 run underway, but for a quick peek at the most you can run:
{{{
./bin/test -vvc lp.bugs.
./bin/test -vvc lp.code.
./bin/test -vvc lp.code.
}}}
== Demo and Q/A ==
This is an optimization branch, so don't expect any changes in functionality. But have a look at: https:/
That page should render fast enough (once qastaging's cache is warmed up to a realistic level) and not break. In fact a cowboyed version of the branch is running on qastaging as I write this.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
BRANCH.TODO
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
Jeroen--
Good improvements, especially the cleaning up of the TAL.
Your tests have a recurring use of makePerson (as user in one block, as author in another) that could be done once in setUp and then reused, which would speed up the testcase.
There are a variety of other calls to makePerson which I think are only to make sure a person other than the user is involved; those could probably also be replaced by creating one other person in setUp and reusing that person.
Otherwise, this looks good.
I'm marking as Approve so you're not blocked on this when you start your day, but I would really like to see the TestCase changes made.