Merge lp:~jtv/launchpad/parallel-make into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-11-18 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11937 |
| Proposed branch: | lp:~jtv/launchpad/parallel-make |
| Merge into: | lp:launchpad |
| Diff against target: |
163 lines (+38/-29) 1 file modified
Makefile (+38/-29) |
| To merge this branch: | bzr merge lp:~jtv/launchpad/parallel-make |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Edwin Grubbs (community) | code | 2010-11-17 | Approve on 2010-11-17 |
| Benji York (community) | code* | Approve on 2010-11-17 | |
|
Review via email:
|
|||
Commit Message
[r=benji,
Description of the Change
= Parallel make =
This fixes the Makefile so that the default target (or "build") can be built in parallel. So instead of "make" you can do "make -j2" and get a nice speedup: on my system right after a "make clean" it takes the build time from 2:43 to 1:32. Should be a welcome change.
What changes? A single buildout run in the makefile produces bin/py and a bunch of other files. But "make" isn't aware that there's no point to running two buildout instances at once, and indeed it's likely to break.
So I channeled all the files produced by buildout through a single virtual target. Now "make" realizes when it's about to run two buildout instances in parallel that they are actually producing the same target—and wait for the existing run to complete instead of starting a redundant one.
(Actually I had to start out with completing dependencies on bin/py, because not all targets that used it depended on it. These things become more noticeable when you run parallel builds.)
The good news is that the build parallelizes almost perfectly to two processes; the bad news is that that's where the ride ends. This is because one single-process job, the generation of WADL files, takes up just about half the build time. With two processors, the two halvse will complete almost simultaneously at just over half the single-process build time. Adding a third CPU won't help the WADL target, and so can't do much for overall build time. At best it gets you to the point where everything waits for that one big job a little faster. On my dual-core SMT laptop, a third process even slows the build down a little.
Jeroen
| Jeroen T. Vermeulen (jtv) wrote : | # |
Thanks. I'm tempted to add that dependency right now, but a quick glance doesn't tell me enough to see how it fits in so I'll leave that for someone else who does see it.
| Edwin Grubbs (edwin-grubbs) wrote : | # |
Jeroen,
This branch looks good. Can you add the dependencies that Benji asked for, and next time, can you submit a really difficult branch for Benji to review so he gets more practice? Oh wait, that means I have to review it, too. Nevermind.
-Edwin
| Jeroen T. Vermeulen (jtv) wrote : | # |
I added the dependency, and broke some over-length lines because, surprisingly, "make lint" also checks the makefile!

This branch looks good. Edwin, my review mentor, will also be reviewing this branch.
The transformation you applied is straightforward. (And welcome, my first day working on LP I ran into this issue).
It's probably not worth adding, because changes are rare, but for completeness I'll note that the buildout_bin rule has an unlisted dependency: buildout.cfg uses template files in buildout-templates (which at the moment is just _pythonpath.py.in).