diff options
author | Brian Harring <ferringb@gmail.com> | 2006-05-11 20:31:56 -0700 |
---|---|---|
committer | Brian Harring <ferringb@gmail.com> | 2006-05-11 20:31:56 -0700 |
commit | e13c1365d14a97d9594c2eb45d1ec126a372a724 (patch) | |
tree | b89228911bb612deeb15de8ddaf1e3282b1e5442 /bin | |
parent | re-enable section instance reuse. (diff) | |
download | pkgcore-e13c1365d14a97d9594c2eb45d1ec126a372a724.tar.gz pkgcore-e13c1365d14a97d9594c2eb45d1ec126a372a724.tar.bz2 pkgcore-e13c1365d14a97d9594c2eb45d1ec126a372a724.zip |
add sorter to itermatch, and optimize the piss out of everything else to use it.
upshot of this, sorting occurs per repo.itermatch return- so for "prefer highest", we've got a set of iterables in sorted order.
Enter util.iterables.iter_sort; func, given a sorting func, maintains iterable order, yielding the cumulative highest.
End result is the same as if you just used a sort on a list, but it pulls only as needed- since for any repo that uses metadata
based visibility filters, this means their *always* will be disk activity, thus converting matches to a list and sorting accesses
packages that may not even be needed. Iteratively sort it in combination with iter_caching, and you access only what's needed.
For system testing, knocked sys time down by 66%.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/utilities/pquery | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/utilities/pquery b/bin/utilities/pquery index bea044ab0..baa125943 100755 --- a/bin/utilities/pquery +++ b/bin/utilities/pquery @@ -131,7 +131,7 @@ if __name__ == "__main__": atoms = packages.OrRestriction(*atoms) for a in atoms: for repo in repos: - for pkg in results_filter(repo.itermatch(a)): + for pkg in results_filter(repo.itermatch(a, sorter=pre_curry(sorted, reverse=True))): try: print str(atomstr(pkg)) except AttributeError: print str(pkg) |