From 07a4422641c25260c770ed0de8a1e08e7fdcdd4e Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 20 Nov 2010 07:18:44 -0300 Subject: [PATCH] qpkg/TODO: cleanup and added new task for consideration - TODO: added section for tasks done - TODO: search tree optimization is done - TODO: added idea of supporting other database formats in the same family --- qpkg/TODO | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/qpkg/TODO b/qpkg/TODO index f0de47e..d1a2792 100644 --- a/qpkg/TODO +++ b/qpkg/TODO @@ -1,20 +1,5 @@ -- optimize the search trees. Right now, we have 81812 calls to make_id - for 14601 packages, resulting in 7420560 calls to comp_id. - - There can be at most 2 new identifiers per package (package name and - version), so a perfectly balanced tree should have a depth of no more - than 14. If we assume that each call to make_id searches to the bottom, - we'd get 1145368 calls to comp_id, about 15% of the current number. - - So the tree is clearly degenerated. - - Update: after switching to red-black trees, we get only 1497604 calls - to comp_id. This is 130% of the "good case" estimate above. Insertion - of a new node is currently done with two lookups, so we'll get rid of - some more lookups after further optimization. - - Update: after merging the two lookups per new node into one, we're at - 1172642 calls to comp_id, or 102% of the predicted "good case". +Still left to do +================ - check whether introducing a new package would cause a conflict @@ -36,3 +21,28 @@ - check database for internal consistency - implement keyword search + +- consider also supporting the similar but not identical (parent ?) format + of /var/lib/dpkg/status and /var/lib/apt/lists/*Packages + + +Done +==== + +- optimize the search trees. Right now, we have 81812 calls to make_id + for 14601 packages, resulting in 7420560 calls to comp_id. + + There can be at most 2 new identifiers per package (package name and + version), so a perfectly balanced tree should have a depth of no more + than 14. If we assume that each call to make_id searches to the bottom, + we'd get 1145368 calls to comp_id, about 15% of the current number. + + So the tree is clearly degenerated. + + Update: after switching to red-black trees, we get only 1497604 calls + to comp_id. This is 130% of the "good case" estimate above. Insertion + of a new node is currently done with two lookups, so we'll get rid of + some more lookups after further optimization. + + Update: after merging the two lookups per new node into one, we're at + 1172642 calls to comp_id, or 102% of the predicted "good case".