Merge lp://staging/~kissiel/checkbox/speed-optimization into lp://staging/checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 4520
Merged at revision: 4517
Proposed branch: lp://staging/~kissiel/checkbox/speed-optimization
Merge into: lp://staging/checkbox
Diff against target: 71 lines (+6/-8)
4 files modified
checkbox-ng/checkbox_ng/misc.py (+1/-1)
plainbox/plainbox/impl/session/state.py (+1/-1)
plainbox/plainbox/impl/unit/test_unit.py (+0/-3)
plainbox/plainbox/impl/unit/unit.py (+4/-3)
To merge this branch: bzr merge lp://staging/~kissiel/checkbox/speed-optimization
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Paul Larson Approve
Review via email: mp+307553@code.staging.launchpad.net

Description of the change

This MR is the first (and simple) patch set that improves plainbox startup time.

The speed-up depends on how many jobs there are in your provider 'database'.

Here are benchmarks from my slow NUC:

1000 jobs - 44s -> 24s
2500 jobs - 2m43s -> 1m19s

The benchmarks were done using this tool:
https://code.launchpad.net/~kissiel/+git/benchcbox/+ref/master

The tool generates providers and checkbox-cli launcher that doesn't run any of the jobs. Measuring wall time of running this launcher gives an estimate how long checkbox takes to 'spool up'.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

Wow, part of me really wants to pick this apart and find if there are even more gains, compare it to normal sets, and things like that, but I see no reason to block such an obvious improvement for any time at all. It's hard to argue with those results, this is great!

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Cool stuff, thanks.

review: Approve
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :
Download full text (10.0 KiB)

The attempt to merge lp:~kissiel/checkbox/speed-optimization into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.11user 0.03system 0:05.50elapsed 2%CPU (0avgtext+0avgdata 9960maxresident)k
[precise] (timing) 0inputs+32outputs (0major+6827minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 45.51user 18.60system 1:07.10elapsed 95%CPU (0avgtext+0avgdata 97156maxresident)k
[precise] (timing) 0inputs+19168outputs (0major+3199615minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: FAIL
[precise-testing] stdout: http://paste.ubuntu.com/23278019/
[precise-testing] stderr: http://paste.ubuntu.com/23278020/
[precise-testing] (timing) Command exited with non-zero status 1
[precise-testing] (timing) 0.69user 0.14system 0:00.85elapsed 98%CPU (0avgtext+0avgdata 48608maxresident)k
[precise-testing] (timing) 0inputs+1280outputs (0major+22164minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 31.22user 0.35system 0:31.61elapsed 99%CPU (0avgtext+0avgdata 150684maxresident)k
[precise-testing] (timing) 0inputs+1376outputs (0major+39712minor)pagefaults 0swaps
Found a test script: ./converged/requirements/container-tests-touch-unit-tests
[precise-testing] container-tests-touch-unit-tests: PASS
[precise-testing] (timing) 0.00user 0.02system 0:00.02elapsed 86%CPU (0avgtext+0avgdata 2232maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2345minor)pagefaults 0swaps
Found a test script: ./plainbox/plainbox/impl/providers/categories/requirements/container-tests-provider-categories
[precise-testing] container-tests-provider-categories: PASS
[precise-testing] (timing) 1.05user 0.09system 0:01.15elapsed 99%CPU (0avgtext+0avgdata 47200maxresident)k
[precise-testing] (timing) 0inputs+64outputs (0major+14466minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.22user 0.05system 0:00.28elapsed 98%CPU (0avgtext+0avgdata 14568maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+6046minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 38.72user 1.39system 0:40.26elapsed 99%CPU (0avgtext+0avgdata 201576maxresident)k
[precise-testing] (timing) 0inputs+3304outputs (0major+263264minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-documentation
[precise-testing] container-tests-plainbox-documentation: PASS
[precise-testing] (timing) 102.37user 0.59system 1:43.22elapsed 99%CPU (0avgtext+0avgdata 185420maxresident)k
[precise-testing] (timing) 0inputs+43216outputs (0major+58278minor)pagefaults 0swaps...

4520. By Maciej Kisielewski

checkbox-ng:misc: use expanded tuple for comparison

This way we check for 'not None' instead of going through full __eq__ chain.

Signed-off-by: Maciej Kisielewski <email address hidden>

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

r.4520 fixes the failing test by unpacking (None, None) tuple and checking 'is not None' for both parts of the pair individually.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches