#18259: Improve mportsearch performance --------------------------------------------+------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 1.8.0 Keywords: search mportsearch performance | Port: --------------------------------------------+------------------------------- 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. -- Ticket URL: <http://trac.macports.org/ticket/18259> MacPorts <http://www.macports.org/> Ports system for Mac OS