Summary: | sys-apps/portage: memoize vercmp function | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Zac Medico <zmedico> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | kingjon3377 |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
vercmp: memoize results
vercmp: memoize results vercmp: memoize results vercmp: memoize results |
Description
Zac Medico
![]() There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_603994 @slyflox, can you test my patch to see how the performance compares to your patch? Created attachment 457858 [details, diff]
vercmp: memoize results
Created attachment 457896 [details, diff]
vercmp: memoize results
* optimize for vercmp(ver1, ver2) == -1 * vercmp(ver2, ver1)
* make depgraph.schedulerGraph() clear the vercmp cache(s)
I didn't test against my patch but did test against vanilla portage. My command: $ time emerge -vuDN @world @preserved-rebuild --keep-going --jobs=2 --with-bdeps=y --complete-graph -p --backtrack=100 NO PATCH: 5 minutes 50 seconds +/- 5 seconds Zac's PATCH: 5 minutes 20 seconds +/- 5 seconds Created attachment 458274 [details, diff] vercmp: memoize results (In reply to Sergei Trofimovich from comment #5) > I didn't test against my patch but did test against vanilla portage. > > My command: > > $ time emerge -vuDN @world @preserved-rebuild --keep-going --jobs=2 > --with-bdeps=y --complete-graph -p --backtrack=100 > > NO PATCH: 5 minutes 50 seconds +/- 5 seconds > Zac's PATCH: 5 minutes 20 seconds +/- 5 seconds I've updated the patch to use a config._vercmp_cache attribute which serves as a shared cache that dbapi instances propagate to the _pkg_str instances that they create. This should give some more cache hits. Created attachment 458276 [details, diff]
vercmp: memoize results
Fixed bug in bintree.py.
We handled this in bug 732378. *** This bug has been marked as a duplicate of bug 732378 *** |