哈哈,我晚上去试一试,比较一下两种方法各自的时间 在 2010年6月8日 下午4:48,Ray Chen <[email protected]>写道:
> > dump_rpm_cache.py 的速度没问题。一般来说RPM API的速度明显快于YUM API > 对已系统已经安装的rpm,只需要查询本系统的rpm数据库,所以很快。 > > 所以问题在于这个文件dump_rpm_existing.py, 里面用了YUM的API > 对于可用(available)的rpm包,需要去查询yum repo。必要是还要下载最新的database, > 所以慢,当然本身yum代码用python分析sqlite性能差。 > > 加个参数试试,应该会快点。 base.doPackageLists(pkgnarrow='available') > > [...@localhost ailurus]$ git diff support/dump_rpm_existing.py > diff --git a/ailurus/support/dump_rpm_existing.py > b/ailurus/support/dump_rpm_existing.py > index 4fe5d70..cdc8a70 100644 > --- a/ailurus/support/dump_rpm_existing.py > +++ b/ailurus/support/dump_rpm_existing.py > @@ -23,7 +23,7 @@ > import sys > from yum import YumBase > base = YumBase() > -ygh = base.doPackageLists() > +ygh = base.doPackageLists(pkgnarrow='available') > for available in ygh.available: > name = available.pkgtup[0] > - print >>sys.stderr, name # because base.doPackageLists prints text to > stdout > \ No newline at end of file > + print >>sys.stderr, name # because base.doPackageLists prints text to > stdout > > Thanks, > Ray > > > > 在2010-06-07 16:06:07,"Homer Xing" <[email protected]> 写道: > > 同意Aron和Yangyang。 其实installed software面板的装载,是先等待yum输出两个数据: > 装了哪些包,存在哪些 包。 如果我们做个实验,让 dump_rpm_cache.py 直接输出空集,那么 installed software > 就能一秒加载。所以我觉得瓶颈在于 yum。 > > 我倒是有个主意,我们可以放弃“显示哪些软件已经装了”的feature。这样就 不用等Yum了。大家觉得呢? > > > 在 2010年6月7日 下午3:59,Aron Xu <[email protected]>写道: > >> 我就是因为yum本身以及中国太慢才转的deb系。。。ailurus 那块本身没多大,主要效率问题在 backend。 >> >> 2010/6/7 Devil Wang <[email protected]>: >> > 悲剧的是我的环境的Fedora, yum 貌似就直接是python写的。 >> > >> > 每次load都花好长时间。 >> > 2010/6/7 Aron Xu <[email protected]> >> >> >> >> dpkg 现在正用 C++ 重写,还有很多是 perl 实现的,效率比较低。 >> >> >> >> 2010/6/7 Yangyang Chen <[email protected]>: >> >> > 貌似installed software加载慢的瓶颈在加载APT缓存。用C++重写的话提高的效率可能不明显吧。调查下先~ >> >> > >> >> > 2010/6/7 Devil Wang <[email protected]> >> >> >> >> >> >> 如题。 >> >> >> 我在加载installed software的时候,要等好久。 >> >> >> python貌似有可以调用C++的功能。 >> >> >> 我想用c++来实现一些底层。是不是可以提高性能? >> >> >> 大家还能分析下可行性? >> >> >> >> >> >> -- >> >> >> Thanks & Regards >> >> >> >> >> >> Linux Developer : Devil Wang >> >> >> >> >> >> _______________________________________________ >> >> >> Mailing list: >> >> >> https://launchpad.net/~ailurus<https://launchpad.net/%7Eailurus> >> >> >> Post to : [email protected] >> >> >> Unsubscribe : >> >> >> https://launchpad.net/~ailurus<https://launchpad.net/%7Eailurus> >> >> >> More help : https://help.launchpad.net/ListHelp >> >> >> >> >> > >> >> > >> >> > _______________________________________________ >> >> > Mailing list: >> >> > https://launchpad.net/~ailurus<https://launchpad.net/%7Eailurus> >> >> > Post to : [email protected] >> >> > Unsubscribe : >> >> > https://launchpad.net/~ailurus<https://launchpad.net/%7Eailurus> >> >> > More help : https://help.launchpad.net/ListHelp >> >> > >> >> > >> > >> > >> > >> > -- >> > Thanks & Regards >> > >> > Linux Developer : Devil Wang >> > >> _______________________________________________ >> Mailing list: >> https://launchpad.net/~ailurus<https://launchpad.net/%7Eailurus> >> Post to : [email protected] >> Unsubscribe : >> https://launchpad.net/~ailurus<https://launchpad.net/%7Eailurus> >> More help : https://help.launchpad.net/ListHelp >> > > > > ------------------------------ > 网易为中小企业免费提供企业邮箱(自主域名) <http://ym.163.com/?from=od3>
_______________________________________________ Mailing list: https://launchpad.net/~ailurus Post to : [email protected] Unsubscribe : https://launchpad.net/~ailurus More help : https://help.launchpad.net/ListHelp

