[PATCH] Performance problems on opensuse version of smart

Christoph Thiel cthiel at suse.de
Wed Aug 29 11:22:31 PDT 2007


Maciej, 

many thanks for improving those patches. I'v just added them to our smart
package, so they will end up in openSUSE 10.3 (and in the openSUSE build
service) soon.


Thanks,
Christoph

On Tue, Aug 28, 2007 at 05:54:55AM +0200, Maciej Kowalczyk wrote:
> Hi,
> I really like Smart package manager but unfortunately the version from  
> suse repositories sometimes works much slower than one from SVN trunk.
> With help from python profiler I concluded that the weakest link is  
> sorting long lists of packages (I have over 12k them in my db).
> The source of problems in your version is  
> smart-better-x86_64-support.patch file. It heavily modifies complexity of  
> RPMPackage.__lt__ method which is critical during sorting operation.
> I created a new version of this patch where some things are precomputed  
> and saved in fields of RPMPackage object. This precomputation takes places  
> during cache loading.
> Then it became clear that another bottleneck is function archscore which  
> is called at least once for every package. It's value depends only on  
> package's arch so I added a memoization of its results. Therefore I assume  
> that architecture's score won't change during program runtime. It's a  
> relation between the architecture and one of the running system so it  
> shouldn't. This technique can of course also be used stock version of  
> Smart.
> I'm attaching this modification as a new version of another of suse  
> patches: smart-fix-archscore-add-disable-biarch-option.patch. If you  
> prefer patches' patches instead, I include them also.
> 
> After applying these two patches instead of the two from version 0.51-34.1  
> 'smart query' test runs twice faster in my config. Also GUI looks more  
> responsive.
> 
> Any comments are welcome. I hope it gets commited somehow.
> 
> --
> 
> Maciej Kowalczyk






-- 
Christoph Thiel, Tech. Project Management, Research & Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)



More information about the Smart mailing list