Merge lp:~jtv/launchpad/bug-884649-branch-3 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Julian Edwards | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 14247 | ||||
Proposed branch: | lp:~jtv/launchpad/bug-884649-branch-3 | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~jtv/launchpad/bug-884649-branch-2 | ||||
Diff against target: |
110 lines (+57/-9) 2 files modified
lib/lp/archivepublisher/domination.py (+31/-9) lib/lp/archivepublisher/tests/test_dominator.py (+26/-0) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-884649-branch-3 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+81136@code.launchpad.net |
This proposal supersedes a proposal from 2011-11-03.
Commit message
[r=julian-edwards] Limit 2nd binary-domination pass to packages with arch-indep publications.
Description of the change
= Summary =
Domination is slow. A major reason is the two-pass domination algorithm needed for binary publications.
== Proposed fix ==
The first binary-domination pass touches only architecture-
The second pass touches only architecture-
So: keep track during the first pass of which packages have architecture-
== Pre-implementation notes ==
This was Julian's idea.
== Implementation details ==
I made the second pass iterate over the intersection of “packages with multiple live publications” and “packages that were found during the first pass to have architecture-
That's not really supposed to happen, which is to say it can be helpful to be prepared for the case but it's not worth optimizing for.
== Tests ==
All the high-level desired outcomes and integration are tested in scenario tests; those remain unchanged because this is a functionally neutral optimization.
I did add one helper function, which is short but easy to mess up and so it gets its own series of tests.
{{{
./bin/test -vvc lp.archivepubli
}}}
== Demo and Q/A ==
Run the dominator. It should be tons faster, but still dominate even architecture-
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
8 +def contains_ arch_indep( bpphs): independent? """ re_specific for bpph in bpphs)
9 + """Are any of the publications among `bpphs` architecture-
10 + return any(not bpph.architectu
11 +
Again be careful of the extra masked query. I assume the FK to BPR is already loaded though.