[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Terribly slow startup in 0.7.2



On Thu, Jun 14, 2007 at 09:27:43PM -0700, Daniel Burrows wrote:
> On Wed, Jun 13, 2007 at 08:47:45PM -0700, Daniel Burrows <dburrows@debian.org> was heard to say:
> >   I think the issue is probably (1).  When I get a chance I'll try to
> > merge in my support for the apt automark branch from 2 years ago -- have
> > the API or the semantics changed since then?
> 
>   Looks like I was right: forward-porting those patches (by hand,
> since darcs sucks) fixed the performance problem.  I'll try to get
> fixed packages up this weekend, maybe to experimental since I'd hate
> to break systems wholescale if I did anything dumb (although it seems
> to work in my tests).

Sorry that I answer so late, attached is a patch that I use to make
aptitudes code use the action groups from libapt. The semantics should
not have been changed since that code was originally written.

Cheers,
 Michael
#! /bin/sh /usr/share/dpatch/dpatch-run
## 09_action_group_integration.dpatch by  <mvogt@acm.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad aptitude-0.4.3~/src/generic/apt/aptcache.cc aptitude-0.4.3/src/generic/apt/aptcache.cc
--- aptitude-0.4.3~/src/generic/apt/aptcache.cc	2006-09-03 19:23:46.000000000 +0200
+++ aptitude-0.4.3/src/generic/apt/aptcache.cc	2006-10-30 09:43:07.000000000 +0100
@@ -167,7 +167,7 @@
 
 aptitudeDepCache::aptitudeDepCache(pkgCache *Cache, Policy *Plcy)
   :pkgDepCache(Cache, Plcy), dirty(false), read_only(true),
-   package_states(NULL), lock(-1), group_level(0),
+   package_states(NULL), lock(-1), group_level(0), apt_action_group(NULL),
    mark_and_sweep_in_progress(false)
 {
   // When the "install recommended packages" flag changes, collect garbage.
@@ -1252,12 +1252,15 @@
 
 void aptitudeDepCache::begin_action_group()
 {
+  if(apt_action_group == NULL)
+     apt_action_group = new pkgDepCache::ActionGroup(*this);
   group_level++;
 }
 
 void aptitudeDepCache::end_action_group(undo_group *undo)
 {
   eassert(group_level>0);
+  eassert(apt_action_group != NULL);
 
   if(group_level==1)
     {
@@ -1267,6 +1270,8 @@
 	    read_only_fail();
 	  return;
 	}
+      delete apt_action_group;
+      apt_action_group=NULL;
 
       mark_and_sweep(undo);
 
diff -urNad aptitude-0.4.3~/src/generic/apt/aptcache.h aptitude-0.4.3/src/generic/apt/aptcache.h
--- aptitude-0.4.3~/src/generic/apt/aptcache.h	2006-09-03 19:23:46.000000000 +0200
+++ aptitude-0.4.3/src/generic/apt/aptcache.h	2006-10-30 09:43:07.000000000 +0100
@@ -199,6 +199,9 @@
   // The current 'group level' -- how many times start_action_group has been
   // called without a matching end_action_group.
 
+  // the apt action group implementation
+  pkgDepCache::ActionGroup *apt_action_group;
+
   /** The number of "new" packages. */
   int new_package_count;
 

Reply to: