RPM Community Forums

Mailing List Message of <rpm-devel>

4.5: back port of tag container cache

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 24 Oct 2007 - 09:14:34 CEST
Message-Id: <49FAEE80-C35B-4C03-9168-FA5BC276584E@mac.com>
I've backported header.c changes from HEAD to the rpm-4.5 branch,
mostly to unsnarl multiple development changes currently on HEAD.

AFAIK, the changes on the rpm-4.5 branch are now complete. There
is a order of magnitude (that's 10x, not 10%, faster) improvement in  
performance
in array queries by caching the array instead of  re-loading for each  
element:

[jbj@wellfleet wdj]$ time rpm -qa --xml --notagcache > /dev/null

real    1m28.452s
user    1m27.669s
sys     0m0.479s

[jbj@wellfleet wdj]$ time rpm -qa --xml --tagcache > /dev/null

real    0m11.803s
user    0m11.284s
sys     0m0.455s

[jbj@wellfleet wdj]$ time rpm -qa --xml --notagcache > /dev/null

real    1m28.413s
user    1m27.934s
sys     0m0.403s

The patch should apply (and should be applied unless you want slower
queries for some obscure reason ;-) to all versions of rpm since  
rpm-4.1 without
too much difficulty, and likely can be pushed all the way back to  
rpm-4.0.x
without too much pain.

There's a "jbj_before_tag_container" tag on the -r rpm-4_5 branch  
ainrpm5.org
cvs that can be used to generate the diff:

     cvs -d :ext:rpm-cvs@rpm5.org:/v/rpm/cvs get -r rpm-4_5 rpm
     cd rpm
     cvs -d :ext:rpm-cvs@rpm5.org:/v/rpm/cvs diff -r  
jbj_before_tag_container

I've also fixed an obscure hack from 8/1998 with RPM_I18NSTRING_TYPE.
While iterating tags in a header (or using the useless  
headerGetRawEntry),
the RPM_I18NSTRING_TYPE is (until I just fixed) being returned as an  
argv
array. Nothing wrong with that per-se, except that the  
RPM_I18NSTRING_TYPE
tags are all string) and scalar, not array) valued:
     Group:
     Description:
     Summary:

So RPM_I18NSTRING_TYPE likely needs to be removed, replacing
with a more general associative array type, but that's a different  
topic ...

Meanwhile, could someone build and check the rpm-4.5 branch please?

Back to unborking HEAD ...

73 de Jeff
Received on Wed Oct 24 09:16:07 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.