summaryrefslogtreecommitdiff
path: root/perllib
AgeCommit message (Collapse)AuthorFilesLines
2012-03-26phash.sh: Use int() for the size of the hash tableH. Peter Anvin1-1/+1
Pass the hash table size to int() to make it a bit more sane. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-11-07Fix Perl deprecation warnings.Victor van den Elzen1-1/+1
Use of defined on aggregates (hashes and arrays) is deprecated. You should instead use a simple test for size.
2010-09-22phash: move sample function to the sample fileH. Peter Anvin1-26/+0
read_input() shouldn't be part of the phash.ph module; instead it should go into the sample usage file phash.pl. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-02-18phash.ph: we haven't required the Graph module for a long timeH. Peter Anvin1-2/+0
We removed the need for the Graph module back at checkin c593173e110244f99a3498cb3e23d6c3c07bae35 in 2008. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-05-25phash: canonicalize order, fix handling of ignored duplicatesH. Peter Anvin1-1/+4
Canonicalize the order of the prehash entries, so we don't have to worry about looking up both pairs of edges. When we find a collision that we decide to ignore, there is no point in adding the same edge into the array again; instead, just skip the current edge.
2008-05-25phash: allow collisions if the hash target is the sameH. Peter Anvin1-1/+1
If the hash target is the same value, we can permit collisions. This isn't relevant for the current applications of the hash generator, but is useful for cases where one have a number of sources for the same target. It's easy to check, either way.
2008-05-25phash: massively speed up the perfect hash generatorH. Peter Anvin23-10963/+50
Make the perfect hash generator about 200x faster by using a very simple custom graph adjacency representation instead of using Graph::Undirected.
2008-05-20phash: cut random vector set down a bitH. Peter Anvin2-195/+3
Reduce the size of the random vector set somewhat
2007-10-02Use the crc64 we already use as the perfect hash function prehashH. Peter Anvin4-156/+442
Use the same crc64 that we already use for the symbol table hash as the perfect hash function prehash. We appear to get radically faster convergence this way, and the crc64 is probably *faster*, since the table likely to be resident in memory.
2007-09-18Change the token prehash function for better convergenceH. Peter Anvin1-2/+2
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-12phash: Tell the user when the graph is OKH. Peter Anvin1-2/+2
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-12phash: Be a bit more aggressive about trying to make a small hashH. Peter Anvin1-1/+1
Change the threshold to 0.7 instead of 0.8.
2007-09-02phash.ph: yet another attempt at getting Perl to behave, arithmeticallyH. Peter Anvin1-7/+15
2007-09-02phash.ph: remove some stale codeH. Peter Anvin1-9/+0
Remove old randomization code which is no longer used.
2007-09-02Force use of integer values for generating hash keys.Chuck Crayne1-2/+4
2007-08-31phash: don't rely on the build platform Perl version of rand()H. Peter Anvin3-58/+168
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-31tokhash: Speed up the rejection of unhashed valuesH. Peter Anvin1-3/+9
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-30phash.ph: use a bipartite graph to reduce the storage requirementsH. Peter Anvin1-13/+19
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-30Finishing touches on perfect hash tokenizer; actually turn the thing onH. Peter Anvin1-2/+4
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-30phash.ph: more powerful prehashingH. Peter Anvin1-14/+20
2007-08-30Make the perfect hash generator an includable moduleH. Peter Anvin1-0/+260
2007-08-29Add README fileH. Peter Anvin1-0/+5
2007-08-29Create a Perl library directory, and add the Graph module to itH. Peter Anvin22-0/+10912
Graph-0.84 from CPAN