Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 83320 - performance issues with rpm-4.1 compared to rpm404 using rpm2html
Summary: performance issues with rpm-4.1 compared to rpm404 using rpm2html
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
URL:
Whiteboard:
: 83315 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-02-02 12:43 UTC by Fabrice Bellet
Modified: 2007-04-18 16:50 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-03 11:15:00 UTC


Attachments (Terms of Use)

Description Fabrice Bellet 2003-02-02 12:43:57 UTC
I experience severe performance differences when reindexing a RPM database with
rpm2html, depending of which version of RPM I link with. For example, on a test
machine, with dual Athlon MP 1900MHz, when reindexing the RedHat 8.0 RPMS
directory, I obtain these values :

rpm-4.1-1.06
  33.750u 8.420s 1:05.68 64.2%    0+0k 0+0io 484pf+0w
rpm-4.1-9
  34.100u 9.350s 1:07.06 64.7%    0+0k 0+0io 491pf+0w
librpm404-8x.27
  11.250u 1.640s 0:12.92 99.7%    0+0k 0+0io 376pf+0w

Comment 1 Jeff Johnson 2003-02-02 13:42:50 UTC
rpm-4.1 verifies signatures and digests when reading
package headers. In particular, the entire payload
will be read to verify the traditional header+payload
signature/digest.

What happens if you recompile rpm2html, adding
    (void) rpmtsSetVSFlags(ts, -1);
immediately after creating a new transaction?

Comment 2 Jeff Johnson 2003-02-02 13:55:28 UTC
*** Bug 83315 has been marked as a duplicate of this bug. ***

Comment 3 Jeff Johnson 2003-02-02 14:03:44 UTC
--- rpmopen.c.orig      2003-02-02 08:58:28.000000000 -0500
+++ rpmopen.c   2003-02-02 08:59:20.000000000 -0500
@@ -1016,6 +1016,7 @@
     /* read the RPM header */
 #if defined(_RPMVSF_NODIGESTS)
     {  rpmts ts = rpmtsCreate();
+       (void) rpmtsSetVSFlags(ts, -1);
        rc = rpmReadPackageFile(ts, fd, buffer, &h);
        ts = rpmtsFree(ts);
     }


Comment 4 Fabrice Bellet 2003-02-02 21:11:19 UTC
That works for me, and I obtain performances close to rpm-4.0.4 now. Moreover, I
 parsed the whole sourceforge archive (RPMS files only) without crashes.


Comment 5 Jeff Johnson 2003-02-03 11:15:00 UTC
OK, I'm gonna assume you're happy, but warn that you
may not have encountered a damaged package. fwiw, rpm-4.1
has stronger sanity checks on header data than rpm-4.0.4,
but the Right Thing To Do to prevent segfaults is to
check a header sha1 digest before parsing. The digest is
present in 8.0 packages and could be cheaply checked by doing
    rpmtsSetVSFlags(ts, ~RPMVSF_NOSHA1HEADER);


Note You need to log in before you can comment on or make changes to this bug.