1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2025-04-21 12:27:27 +03:00

qpkg: optimize duplicate lookup when inserting a new name

- jrb.h, jrb.c (jrb_find_or_insert): new function to look for a node and
  to insert a new one if not found
- id.c (make_id): use jrb_find_or_insert to avoid looking up new nodes
  twice
- TODO: report the improvement
This commit is contained in:
Werner Almesberger
2010-11-19 22:20:15 -03:00
parent 64c70e77f4
commit 03c5e4ffe7
4 changed files with 24 additions and 6 deletions

View File

@@ -10,9 +10,12 @@
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 lookup, so we'll get rid of
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".
- check whether introducing a new package would cause a conflict
- compile the list of conflicts of installed packages