JPerf 1.0.0

JPerf is a Java library, a perfect hash function generator.
JPerf is a Java library, a perfect hash function generator.

Perfect hashing is much written about but less often used. The principle is to reduce the average constant overhead of a hash table by precomputing a hash function which is optimal for the key set. Other advantages include a reduction in memory usage. % Finding such a hash function is hard, especially in the general case and these run-time savings come at a cost of increased map creation time.

Users of the C programming language will no doubt be familiar with gperf, a much more complete tool which generates C source for a perfect hash. Douglas C Schmidt's paper was an invaluable resource in the creation of this library.

Using the Library

The structure of this library is as follows: The user creates a PerfectMapGenerator, adds the key-value pairs to it, and then asks the generator to create a Map. The returned Map is a perfect hash for the given keys and values. The JPerf library offers a general purpose PerfectMapGenerator for Java Objects, and a special case for Java Strings.

Future versions of this library may also generate source code, or even a Class at runtime using the asm library. However, the nature of Java is such that these options may not offer much (if any) runtime performance benefit over the generated Map, and the only cost saved is that of generation time (which may be significant).

last updated on:
April 14th, 2008, 1:06 GMT
price:
FREE!
developed by:
Shevek
license type:
GPL (GNU General Public License) 
category:
ROOT \ Programming \ Libraries

FREE!

In a hurry? Add it to your Download Basket!

user rating 18

UNRATED
2.9/5
 

0/5

Add your review!

SUBMIT