WITH_HASH_MAP

Ralf Corsepius rc040203 at freenet.de
Tue Jun 27 21:45:21 PDT 2006


Hi,

apt-pkg/rpm/* contains a conditionally compiled code using a define
named WITH_HASH_MAP.

AFAIS, this seems to be an incomplete attempt to use hash_map<> instead
of map<> for some kind of dictionary operations.

ATM, WITH_HASH_MAP is never defined, so the code will never be compiled
nor used.

Question: What to do?

If we want to get this functional, we should at least add some magic
corresponding magic to the configure script to activate this code.
If we don't want to get this functional, I'd be in favor of eliminating
this "dead code".

Subquestions, I currently can't answer:

* Would be using hash_map<>'s be worth it?
Generally speaking, my attitude on them is ambivalent: On one hand, they
are non-portable, tedious to use and an additional source of errors, but
promise a speed up. Is such a speed up sensible/measurable in these
particular cases? I don't know.

* Would be keeping the current implementation of hash_map<> support be
worth it?
IMO, the current implementation is problematic (to say the least).
I do not think keeping it is worth it.

For the moment, I'd propose to add another option to configure (say
--enable-experimental), which would optionally compile apt with
"WITH_HASH_MAP". We'd then pretty soon know if this code is functional
at all, and if it provides a measurable speed up.

Ralf






More information about the Apt-Rpm mailing list