mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Regenerated.
This commit is contained in:
@@ -1,53 +1,29 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- This HTML file has been created by texi2html 1.51
|
||||
from gperf.texi on 15 April 1998 -->
|
||||
from gperf.texi on 20 August 2000 -->
|
||||
|
||||
<TITLE>User's Guide to gperf - 6 Things Still Left to Do</TITLE>
|
||||
<TITLE>Perfect Hash Function Generator - 7 Implementation Details of GNU gperf</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to the <A HREF="gperf_1.html">first</A>, <A HREF="gperf_8.html">previous</A>, <A HREF="gperf_10.html">next</A>, <A HREF="gperf_11.html">last</A> section, <A HREF="gperf_toc.html">table of contents</A>.
|
||||
<P><HR><P>
|
||||
|
||||
|
||||
<H1><A NAME="SEC21" HREF="gperf_toc.html#TOC21">6 Things Still Left to Do</A></H1>
|
||||
<H1><A NAME="SEC22" HREF="gperf_toc.html#TOC22">7 Implementation Details of GNU <CODE>gperf</CODE></A></H1>
|
||||
|
||||
<P>
|
||||
It should be "relatively" easy to replace the current perfect hash
|
||||
function algorithm with a more exhaustive approach; the perfect hash
|
||||
module is essential independent from other program modules. Additional
|
||||
worthwhile improvements include:
|
||||
A paper describing the high-level description of the data structures and
|
||||
algorithms used to implement <CODE>gperf</CODE> will soon be available. This
|
||||
paper is useful not only from a maintenance and enhancement perspective,
|
||||
but also because they demonstrate several clever and useful programming
|
||||
techniques, e.g., `Iteration Number' boolean arrays, double
|
||||
hashing, a "safe" and efficient method for reading arbitrarily long
|
||||
input from a file, and a provably optimal algorithm for simultaneously
|
||||
determining both the minimum and maximum elements in a list.
|
||||
|
||||
</P>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
|
||||
Make the algorithm more robust. At present, the program halts with an
|
||||
error diagnostic if it can't find a direct solution and the <SAMP>`-D'</SAMP>
|
||||
option is not enabled. A more comprehensive, albeit computationally
|
||||
expensive, approach would employ backtracking or enable alternative
|
||||
options and retry. It's not clear how helpful this would be, in
|
||||
general, since most search sets are rather small in practice.
|
||||
|
||||
<LI>
|
||||
|
||||
Another useful extension involves modifying the program to generate
|
||||
"minimal" perfect hash functions (under certain circumstances, the
|
||||
current version can be rather extravagant in the generated table size).
|
||||
Again, this is mostly of theoretical interest, since a sparse table
|
||||
often produces faster lookups, and use of the <SAMP>`-S'</SAMP> <CODE>switch</CODE>
|
||||
option can minimize the data size, at the expense of slightly longer
|
||||
lookups (note that the gcc compiler generally produces good code for
|
||||
<CODE>switch</CODE> statements, reducing the need for more complex schemes).
|
||||
|
||||
<LI>
|
||||
|
||||
In addition to improving the algorithm, it would also be useful to
|
||||
generate a C++ class or Ada package as the code output, in addition to
|
||||
the current C routines.
|
||||
</UL>
|
||||
|
||||
<P><HR><P>
|
||||
Go to the <A HREF="gperf_1.html">first</A>, <A HREF="gperf_8.html">previous</A>, <A HREF="gperf_10.html">next</A>, <A HREF="gperf_11.html">last</A> section, <A HREF="gperf_toc.html">table of contents</A>.
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user