[Rpm-maint] [PATCH] [RFC] 33% speedup in RPM!

Bill Nottingham notting at redhat.com
Tue Jun 26 04:59:28 UTC 2007


Testing used for the following patch:

- P4, 2Ghz
- 512MB memory
- local repos
- upgrade a F7 GA chroot (866 packages, desktop install)
  to updates + updates-testing, using yum
- upgrades done on a fresh reboot (clean cache)

The attached patch shaves the run time for the full update from
22m37s to 15m19s. Even accounting for minor differences in disk
location, that's a *significant* savings.

Of course, it's a complete buzzsaw of a patch. To make this work,
we'd need:

1) define one run of this as a post-transaction tool
2) make it packaging policy that the proper symlinks always be
   shipped in the package

Opinions?

Bill
-------------- next part --------------
--- rpm-4.4.2/lib/psm.c.foo	2007-04-25 18:26:27.000000000 -0400
+++ rpm-4.4.2/lib/psm.c	2007-04-25 18:29:01.000000000 -0400
@@ -646,21 +646,15 @@
 
     psm->sq.reaper = 1;
 
-    /* XXX bash must have functional libtermcap.so.2 */
-    if (!strcmp(n, "libtermcap"))
-	ldconfig_done = 0;
-
     /*
      * If a successor node, and ldconfig was just run, don't bother.
      */
-    if (ldconfig_path && progArgv != NULL && psm->unorderedSuccessor) {
- 	if (ldconfig_done && !strcmp(progArgv[0], ldconfig_path)) {
+    if (ldconfig_path && progArgv != NULL && !strcmp(progArgv[0], ldconfig_path)) {
 	    rpmMessage(RPMMESS_DEBUG,
 		_("%s: %s(%s-%s-%s.%s) skipping redundant \"%s\".\n"),
 		psm->stepName, tag2sln(psm->scriptTag), n, v, r, a,
 		progArgv[0]);
 	    return rc;
-	}
     }
 
     rpmMessage(RPMMESS_DEBUG,
@@ -672,19 +666,16 @@
 	argv = alloca(5 * sizeof(*argv));
 	argv[0] = "/bin/sh";
 	argc = 1;
-	ldconfig_done = 0;
     } else {
 	argv = alloca((progArgc + 4) * sizeof(*argv));
 	memcpy(argv, progArgv, progArgc * sizeof(*argv));
 	argc = progArgc;
-	ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path)
-		? 1 : 0);
     }
 
 #if __ia64__
     /* XXX This assumes that all interpreters are elf executables. */
     if ((a != NULL && a[0] == 'i' && a[1] != '\0' && a[2] == '8' && a[3] == '6')
-     && strcmp(argv[0], "/sbin/ldconfig"))
+     && strcmp(argv[0], ldconfig_path))
     {
 	const char * fmt = rpmGetPath("%{?_autorelocate_path}", NULL);
 	const char * errstr;
@@ -749,9 +740,6 @@
 	    xx = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
 	}
 
-	if (ldconfig_path && strstr(script, ldconfig_path) != NULL)
-	    ldconfig_done = 1;
-
 	xx = Fwrite(script, sizeof(script[0]), strlen(script), fd);
 	xx = Fclose(fd);
 


More information about the Rpm-maint mailing list