If more than 20 file collisions occur, only look up the first 20 since
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Jul 2010 08:16:33 +0000 (01:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Jul 2010 08:16:33 +0000 (01:16 -0700)
get_owners is slow for large numbers of files.

pym/portage/dbapi/vartree.py

index 5953997f3ad3e78bf4b0b2d09d2ba6c8b8de29ed..24588fb2e6e811f642afb61cd6b9df325fda6f95 100644 (file)
@@ -3747,6 +3747,10 @@ class dblink(object):
                                msg.append("")
                                eerror(msg)
 
+                               if len(collisions) > 20:
+                                       # get_owners is slow for large numbers of files, so
+                                       # don't look them all up.
+                                       collisions = collisions[:20]
                                owners = self.vartree.dbapi._owners.get_owners(collisions)
                                self.vartree.dbapi.flush_cache()