April 27, 2008
Developing: Java IRC daemon
Developing: Linguistics library
Destination: Scotland
April 10, 2008
Destination: Washington DC
State: exhausted
March 3, 2008
Major update of the Java C Preprocessor
August 10, 2007
First release of a LynxFS driver for Linux
August 7, 2007
Karmasphere Labs goes live and interactive.
March 27, 2007
I finally released the C Preprocessor in Java.
December 7, 2006
Location: England
State: shattered
November 28, 2006
The first redesign for this site in nearly 10 years. It's 1am now, so the content update will have to wait.
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.
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).
The license is GPL-2. Subversion access is available on request. Less restrictive licenses are freely available on request, but please ask, because I want people to use this software, but I'm curious to know who is using it and for what purpose.