posted on April 12, 2011
Wrote some code to read list of installed packages (CPV - category, package, version) using the Gentoolkit api, as well as the Portage dbapi. Here’s the results !
#!/usr/bin/env python
from time import time
= time ()
startg from gentoolkit.helpers import get_installed_cpvs
for cpv in sorted (get_installed_cpvs ()):
print cpv
= time ()
endg
= time ()
startp from portage.dbapi.vartree import vartree
= vartree ()
vt for cpv in sorted (vt.getallcpv ()):
print cpv
= time ()
endp
print "Gentoolkit", endg - startg
print "Portage", endp - startp
...
...
xfce-extra/xfce4-power-manager-1.0.10
xfce-extra/xfce4-sensors-plugin-1.0.0-r1
xfce-extra/xfce4-taskmanager-1.0.0
Gentoolkit 2.60817313194
Portage 0.0787289142609
Portage dbapi is way faster than Gentoolkit :)