From 573b7786a828268d6eb2c26ceb74814a7041cf64 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 25 Oct 2016 13:06:06 -0400 Subject: reproducible debian: speed up _scheduler.py significantly This fix has to important parts: (1) changing a list to set for fast looks ups, and (2) changing a slqalchemy RowProxy object to a tuple for fast comparisons. Signed-off-by: Holger Levsen --- bin/reproducible_scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py index b279e021..bb0659e5 100755 --- a/bin/reproducible_scheduler.py +++ b/bin/reproducible_scheduler.py @@ -239,7 +239,7 @@ def update_sources_db(suite, arch, sources): # get the current packages in the database query = "SELECT name, version, suite, architecture FROM sources " + \ "WHERE suite='{}' AND architecture='{}'".format(suite, arch) - cur_pkgs = query_db(query) + cur_pkgs = set([(p.name, p.version, p.suite, p.architecture) for p in query_db(query)]) pkgs_to_add = [] updated_pkgs = [] different_pkgs = [x for x in new_pkgs if x not in cur_pkgs] -- cgit v1.2.3-70-g09d2