J?rgen H?tzel ([EMAIL PROTECTED]) scribbled: > Because portage searches took so long on my notebook i started > profiling and found the bottleneck in > > class portdbapi::cp_all (/usr/lib/portage/pym/portage.py) > > a huge list is generated and returned. Its better to yield each single > entry. Generators are part of python since 2.3.0. I wonder why they > are not used in portage. Look at the performance improvement of my patch: > > bash-2.05b# time emerge search python-mode > Searching... > [ Results for search key : python-mode ] > [ Applications found : 2 ] > .. > real 0m6.845s > user 0m6.536s > sys 0m0.137s > > After applying the patch: > > bash-2.05b# time emerge search python-mode > Searching... > [ Results for search key : python-mode ] > [ Applications found : 2 ] > .. > real 0m2.323s > user 0m1.914s > sys 0m0.142s [snip cool patch]
You may want to look at eix, also. It doesn't relate at all (different language, and db), but damn it's quick. :) #################################################### [EMAIL PROTECTED] # time eix python-mode Search results: 2 ... real 0m0.053s user 0m0.023s sys 0m0.007s #################################################### It's in app-portage. Cooper. -- [email protected] mailing list
