Ticket #18259 (closed enhancement: fixed)
Improve mportsearch performance
| Reported by: | blb@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts 1.8.0 |
| Component: | base | Version: | 1.8.0 |
| Keywords: | search mportsearch performance | Cc: | jmr@… |
| Port: |
Description
Attached is a patch which changes how mportsearch works:
- now it always reads in all of each PortIndex available in ${sources}
- goes through the cached data from that read to find possible matches
From a speedup point-of-view, it appears to increase the speed of multiple mportsearches in one run of port by 20%+. For example, running a dry-run install of gnome (port-test is a trunk-based installed with no ports installed):
$ time port-test -dy install gnome > gnome_orig.txt 2>&1 real 1m10.154s user 1m0.102s sys 0m9.089s
After the attached patch:
$ time port-test -dy install gnome > gnome_patch.txt 2>&1 real 0m50.689s user 0m43.276s sys 0m6.508s
The disadvantage is that memory usage increases; watching top for both of the above tests shows the original peaking at about 344M, the patched at about 419M (so about a 20% increase in memory usage).
The debug output from each is identical.
As the dependency tree has been increasing lately (use_* adding the proper deps, various X11-based changes) speeding this up is becoming more important.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


