Commit Graph

12 Commits

Author SHA1 Message Date
H. Peter Anvin
5255fd1f36 Change the token prehash function for better convergence
Combining arithmetric (add) and bitwise (xor) mixing seems to give
better result than either.

With the new prehash function, we find a valid hash much quicker.
2007-09-18 12:38:07 -07:00
H. Peter Anvin
ff6e9b4699 phash: Tell the user when the graph is OK
Tell the user when the graph is OK, so that we don't get quite so much of
"a list of errors followed by a long pause."
2007-09-12 16:55:57 +00:00
H. Peter Anvin
cdea6f96b6 phash: Be a bit more aggressive about trying to make a small hash
Change the threshold to 0.7 instead of 0.8.
2007-09-12 01:27:53 +00:00
H. Peter Anvin
e17a3cb29d phash.ph: yet another attempt at getting Perl to behave, arithmetically 2007-09-02 14:46:00 +00:00
H. Peter Anvin
e3e9e9fa0d phash.ph: remove some stale code
Remove old randomization code which is no longer used.
2007-09-02 06:20:15 +00:00
Chuck Crayne
757dfad900 Force use of integer values for generating hash keys. 2007-09-02 01:00:34 +00:00
H. Peter Anvin
b938e043ca phash: don't rely on the build platform Perl version of rand()
rand() in Perl can vary between platforms, so don't use it.  Instead,
remove a completely pointless level of indirection (it introduced a
permutation which cancelled itself out) and provide a canned set of
random numbers for the rest.  This guarantees we will always use the
same numbers.
2007-08-31 18:10:23 +00:00
H. Peter Anvin
91a86cdb31 tokhash: Speed up the rejection of unhashed values
Speed up the rejection of unhashed values (typically identifiers) by
filling unused hash slots with a large value (but not so large that
it is likely to overflow.)  This means those values will be rejected
already by the range check, not needing strcmp().
2007-08-31 07:23:31 +00:00
H. Peter Anvin
fb5a599c8a phash.ph: use a bipartite graph to reduce the storage requirements
Since we fold the f- and g-functions together, if we guarantee that g is
bipartite, we can make g twice the size of f without cost.  This greatly
improves the odds of generating a smaller hash.
2007-08-30 23:42:39 +00:00
H. Peter Anvin
74cc5e569c Finishing touches on perfect hash tokenizer; actually turn the thing on
Finish the perfect hash tokenizer, and actually enable it.

Move stdscan() et al to a separate file, since it's not needed in any
of the clients of nasmlib other than nasm itself.

Run make alldeps.
2007-08-30 22:35:34 +00:00
H. Peter Anvin
215c1a3781 phash.ph: more powerful prehashing 2007-08-30 21:39:37 +00:00
H. Peter Anvin
b44d7a76a2 Make the perfect hash generator an includable module 2007-08-30 20:15:25 +00:00