I'm new to the list, so let me know if I'm completely crazy.

I noticed that the "Resolving any missing task queue dependencies" step takes quite a while, depending on the size of the environment (number of .bb files being processed). Stepping into the bitbake code for the first time I noticed the providers.py getRuntimeProviders() function calling re.compile() on the same data over and over again. Provided is a patch that moves this step into the cache.py Cache::handleData() function so it is ran once for each package rather than multiple times.

The patch is against the latest source release, 1.8.19.

--
Nathan Bell
/Software Engineer/
Action Target Inc.
801-377-8033 x154
[email protected] <mailto:[email protected]>
www.actiontarget.com <http://www.actiontarget.com>
"Better Equipped. Better Prepared"
diff -ruN bitbake-1.8.19.orig/lib/bb/cache.py bitbake-1.8.19/lib/bb/cache.py
--- bitbake-1.8.19.orig/lib/bb/cache.py 2010-12-23 13:26:03.000000000 -0700
+++ bitbake-1.8.19/lib/bb/cache.py      2011-02-11 14:39:57.000000000 -0700
@@ -405,6 +405,12 @@
             if not package in cacheData.packages_dynamic:
                 cacheData.packages_dynamic[package] = []
             cacheData.packages_dynamic[package].append(file_name)
+            if not package in cacheData.packages_dynamic_pattern:
+                try:
+                    cacheData.packages_dynamic_pattern[package] = 
re.compile(package.replace('+', "\+"))
+                except:
+                    bb.msg.error(bb.msg.domain.Provider, "Error parsing re 
expression: %s" % pattern)
+                    raise
 
         for rprovide in rprovides:
             if not rprovide in cacheData.rproviders:
@@ -503,6 +509,7 @@
         self.rproviders = {}
         self.packages = {}
         self.packages_dynamic = {}
+        self.packages_dynamic_pattern = {}
         self.possible_world = []
         self.pkg_pn = {}
         self.pkg_fn = {}
diff -ruN bitbake-1.8.19.orig/lib/bb/providers.py 
bitbake-1.8.19/lib/bb/providers.py
--- bitbake-1.8.19.orig/lib/bb/providers.py     2010-12-23 13:26:03.000000000 
-0700
+++ bitbake-1.8.19/lib/bb/providers.py  2011-02-11 14:39:51.000000000 -0700
@@ -297,11 +297,7 @@
 
     # Only search dynamic packages if we can't find anything in other variables
     for pattern in dataCache.packages_dynamic:
-        try:
-            regexp = re.compile(pattern.replace('+', "\+"))
-        except:
-            bb.msg.error(bb.msg.domain.Provider, "Error parsing re expression: 
%s" % pattern)
-            raise
+        regexp = dataCache.packages_dynamic_pattern[pattern]
         if regexp.match(rdepend):
             rproviders += dataCache.packages_dynamic[pattern]
 
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to