diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 16:46:36 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 16:46:36 -0700 |
commit | 711b0c1e396d634c35fee3757d807ae874bc3571 (patch) | |
tree | 04d6a3d1ef6f65e0ae08e925c8f96b606ff02b27 | |
parent | 3be5d859139b8bf1ed6b8a9833eed99d016cd257 (diff) | |
download | nasm-711b0c1e396d634c35fee3757d807ae874bc3571.tar.gz nasm-711b0c1e396d634c35fee3757d807ae874bc3571.tar.bz2 nasm-711b0c1e396d634c35fee3757d807ae874bc3571.zip |
phash: cut random vector set down a bit
Reduce the size of the random vector set somewhat
-rw-r--r-- | perllib/phash.ph | 6 | ||||
-rw-r--r-- | perllib/random_sv_vectors.ph | 192 |
2 files changed, 3 insertions, 195 deletions
diff --git a/perllib/phash.ph b/perllib/phash.ph index 487b12e..a274e11 100644 --- a/perllib/phash.ph +++ b/perllib/phash.ph @@ -146,7 +146,7 @@ sub gen_perfect_hash($) { # Minimal power of 2 value for N with enough wiggle room. # The scaling constant must be larger than 0.5 in order for the # algorithm to ever terminate. - my $room = scalar(@keys)*0.7; + my $room = scalar(@keys)*0.8; $n = 1; while ($n < $room) { $n <<= 1; @@ -156,14 +156,14 @@ sub gen_perfect_hash($) { $maxj = scalar @random_sv_vectors; for ($i = 0; $i < 4; $i++) { - print STDERR "Trying n = $n...\n"; + printf STDERR "%d vectors, trying n = %d...\n", + scalar @keys, $n; for ($j = 0; $j < $maxj; $j++) { $sv = $random_sv_vectors[$j]; @hashinfo = gen_hash_n($n, $sv, $href, $run++); return @hashinfo if (defined(@hashinfo)); } $n <<= 1; - $maxj >>= 1; } return; diff --git a/perllib/random_sv_vectors.ph b/perllib/random_sv_vectors.ph index ae67d1f..db2dc6e 100644 --- a/perllib/random_sv_vectors.ph +++ b/perllib/random_sv_vectors.ph @@ -1,124 +1,4 @@ @random_sv_vectors = ( - [0x4f75e86a, 0xa619a221], [0x4211d883, 0x375af6e6], - [0x7657d667, 0x6333e69f], [0x51306ad6, 0xe87a75b2], - [0x818469e6, 0x19a9e82d], [0x623da09e, 0x169c4031], - [0xc3012f83, 0xbdf48dd0], [0xfcbb1f89, 0x0c51d7c9], - [0xe1e3397b, 0x8ff4d865], [0x0ac918f1, 0x4f9ec6bb], - [0xbe18da0f, 0xd87be655], [0x0f0e0e53, 0xf1288c8b], - [0xf9d28c2b, 0xf8ab94c8], [0xcfabcfae, 0x6d08b1dc], - [0xe496f39b, 0x548e8257], [0xd21e139e, 0x721b5256], - [0xbdc4bf74, 0x03160c9e], [0xd19ef1b3, 0x0ca3b520], - [0x8f52dfbd, 0x4c7a6224], [0xc67399be, 0xbb88e496], - [0x334cdf5b, 0x4a7884e6], [0x46b89a7a, 0xaafbd448], - [0x0f5f12a1, 0x3694d0f1], [0x376fd093, 0xd0dac844], - [0xcc21a4bd, 0x11fb3780], [0x0fdf4036, 0x5b51fc12], - [0x4f8ffd03, 0xea2579a6], [0x8f8cc719, 0x7c11acb4], - [0x2fe1ee56, 0x9c781da6], [0x4db1da0d, 0xb65cb4e3], - [0x70b53ff6, 0x98f35a3e], [0x9bf52704, 0x66c9f702], - [0x9ea4aa9c, 0xa45cb773], [0x1b745933, 0x0e4df7c1], - [0xd9f3cc40, 0x78b8e00f], [0x131620ea, 0x6c693290], - [0xbc0e10dd, 0x2d8de15e], [0x3e7684e5, 0x15358338], - [0x427f025b, 0x1bea99b8], [0x9e36e80a, 0x5cc209f7], - [0xe96ecd24, 0x164c80ad], [0x2a0fd487, 0x34ae53a8], - [0x374d10ad, 0xf8ba703e], [0xc7b7025c, 0x726fd38c], - [0xc9c71681, 0x749fe58c], [0x54c146f9, 0xcf5d5eed], - [0xdd63a845, 0x5b409a2b], [0x6c1eb5df, 0x236f3d7a], - [0x3f26e454, 0x6c6ddbda], [0xde49583e, 0x854d25f8], - [0x77cc1c8b, 0xb9f44f2f], [0x504d08d7, 0x8a15f37b], - [0x0fa90449, 0x767c45e6], [0x353dd4f6, 0x3945abc3], - [0x279cc804, 0x9aca2078], [0xc0889e29, 0x0887bc4b], - [0x6befcf7a, 0x34579438], [0xa1e96c99, 0x4e8d958e], - [0x7e92c701, 0x8cafd3e4], [0x88194b29, 0x549baa5b], - [0x37d5a863, 0x6d158281], [0xe39bfd81, 0xeeba2b1f], - [0xf0b45736, 0x909cd899], [0x36528974, 0x3864d47c], - [0xe8c776af, 0x9a09b791], [0x2178fa44, 0x283993fb], - [0x7705f641, 0x6b77e579], [0x3be99f1a, 0xddb55ee7], - [0x933e4adf, 0x8bf2a4d5], [0x60bd229f, 0x553a1880], - [0xf71eecc0, 0x44540d74], [0x0b2e0f02, 0x51f94819], - [0x9acb45f1, 0x56ff9489], [0x55deac30, 0xf40bd69f], - [0xc7c65da9, 0x6e98523f], [0xd20df531, 0x73229a8b], - [0x56736755, 0x58f1155e], [0x6bd03660, 0x75c2d26c], - [0x62228cdc, 0x49ea4855], [0x0856f45a, 0xd59f5a1e], - [0x2b2e8407, 0x508bb429], [0xa24b81e7, 0xd2c1752b], - [0xc1eedb28, 0xf5dc5ff0], [0xb177d794, 0xdab6f4c7], - [0xbfb6ab33, 0x77d416c3], [0x4c700e4c, 0x80f7f3ef], - [0xe347cd1d, 0xc99d97fd], [0xb956c326, 0x1db9795c], - [0xd9a297a2, 0x4fb27f28], [0xeab7b30a, 0xe6eb4149], - [0x9322674d, 0xd64f5309], [0x3a2af9ac, 0x8b5cbd69], - [0x00d7dca2, 0xa310e46e], [0x56e42d70, 0xd5c2992f], - [0x43f07ed8, 0x3bfab03e], [0x143a4553, 0xe639bbee], - [0xf60cabf6, 0xc6a3424a], [0xc750ba59, 0x9740ce3d], - [0x1675449d, 0xc8eaadb3], [0x58624a9f, 0xb57239fc], - [0x929c104e, 0x56f27b11], [0x37d4ebfd, 0xa16cc57b], - [0x94053a40, 0x76241e44], [0x45476224, 0xc691a365], - [0x79850c7b, 0x453d196a], [0xd7aab2ad, 0xaff8d277], - [0x50832666, 0xcd0d459b], [0x56b44783, 0xdc79d8ed], - [0x8ff6b84b, 0x66d87d23], [0xa7c60d26, 0xe987e43a], - [0x930ca6a5, 0xc24f2033], [0xf2563f72, 0x309e4a30], - [0xf453bad1, 0x0a72b87a], [0xdf0847c5, 0x8edd6a2d], - [0x40027952, 0x0fa1766e], [0xe5debb75, 0x4129a8e1], - [0xdba91181, 0xc1412803], [0x281f61d6, 0xb08052f1], - [0x7971effd, 0x445d6c35], [0x1a146185, 0xd4954510], - [0xb6bb87e9, 0xc2f5fc7d], [0xc49159ad, 0xf82c3a57], - [0x2af4ec6e, 0x4d292183], [0xff3153dd, 0x64fad735], - [0x2c2538fc, 0x58a8b44a], [0x3968b689, 0xb48830eb], - [0x08c13fc4, 0xa923fb77], [0x369bc946, 0x260baa8a], - [0x9ddc8916, 0x40e92e7d], [0xa136cd43, 0xe4c6d889], - [0x5de28e5a, 0x7cd5f555], [0xcfbe100e, 0xf4e907c5], - [0x1ad38836, 0xd1b65d61], [0x0f84eae1, 0xb7af25a1], - [0x555bde94, 0x30eff969], [0x841d6e2a, 0xd64de0e9], - [0x9bbe13c2, 0xe7540d27], [0x2c8ec90c, 0x7ce816b3], - [0x0314b049, 0xfc5c9b2d], [0x335b3350, 0x7c1c4afc], - [0xa33d8419, 0xae85e9fc], [0x22646aac, 0xba58e66c], - [0x716418c7, 0x51e1cd9c], [0x1240dde1, 0xba0cc0ec], - [0xb5a6057c, 0x148d2c74], [0x68450010, 0xeea292bf], - [0x229b3221, 0xea792408], [0x528b20c4, 0xea2c5951], - [0xa8f0779c, 0x42010fb9], [0x2cc31f92, 0x67b244b0], - [0xb01b74f9, 0x5c1c2dbe], [0xf6810206, 0x258f9b43], - [0x23f41154, 0x51e23da9], [0x4c1dd303, 0x34ec2d34], - [0xb0cfaa95, 0x79ca912e], [0x1c14beeb, 0xdc931183], - [0xbb752e92, 0xbf5468c7], [0x4471962b, 0xc19f6dc0], - [0x673f96ec, 0x4902ef9f], [0x724ae7a2, 0x2a6a2eca], - [0xd3a3d443, 0xe5e79fee], [0x8ab86260, 0x4a398e5d], - [0x6f6200bc, 0xaf5a76bd], [0x32620350, 0x2cfd5327], - [0x16fe8e0b, 0x6a9b06ff], [0x71b2da77, 0xd11fddce], - [0x5c522528, 0xf4a87761], [0x5bd78f68, 0xd2c6df8f], - [0x0cdba679, 0x8abcbaf7], [0x80a6f94b, 0x327bead4], - [0x27db6849, 0xe47358f6], [0x2ab4f45e, 0x0a053dc7], - [0xc87a9f0d, 0x0281bd95], [0x0f577c99, 0x8b3dae49], - [0xfe5b8224, 0x219c31c7], [0x5376dbe2, 0x4d9a7b99], - [0xca8ba206, 0xe402e775], [0x503287bc, 0x45a0bb90], - [0x1ae2e66b, 0x9f4a1142], [0xbdd6a2e6, 0xe739841b], - [0xeb2bb9dd, 0x196d2bbf], [0x0009ada3, 0x1f4a8903], - [0x136e3097, 0xb2835ac6], [0xbcb6442a, 0x34d024bd], - [0xe9dacc26, 0xb8ab0020], [0xdc8d67b8, 0xd15cc22c], - [0x4cac7bcb, 0x65526228], [0xf5460d00, 0xc9a38d07], - [0xc4f58a1a, 0x2034a9d6], [0xe19e425c, 0xae2c34ad], - [0x5904e642, 0x5ddb47b3], [0x9f635b83, 0x2ce2c1e1], - [0xa91ab3e2, 0x9e42c598], [0x0633c4c4, 0xae235414], - [0x3701d10b, 0x35e9288f], [0x8019c970, 0x3b7e7894], - [0xd829ab85, 0x4f779cbb], [0x42001b88, 0x3ed354e0], - [0x41924a24, 0x48a62944], [0x1eefe1da, 0x1b37c591], - [0x867e9dd5, 0xad80bf59], [0xe8e35fd5, 0x1aaf0305], - [0x331583b4, 0x3286194b], [0x576e57aa, 0x8b518367], - [0x0dddf5f8, 0xd8fe4dd0], [0x5da13726, 0xe96b0257], - [0x7f17c240, 0x831ad957], [0x95df4b2f, 0x01947e5d], - [0x79b6e0ef, 0xa99c3a83], [0x0dc2f9d7, 0x76b8fc6c], - [0x453a7daf, 0xdf747b17], [0x5b86e795, 0x4107c74a], - [0xcad959a5, 0x5c59fcd6], [0x6c6f1e84, 0x191032a5], - [0xe272368d, 0xfe5068e1], [0x3b999268, 0xfc720e4d], - [0x2aa05ccc, 0x8bf5a0b5], [0xbbff5284, 0xa445a0cf], - [0xa7bd1807, 0x0c98ca2b], [0x618ca6b2, 0x832c7588], - [0x44a6028e, 0x178eefd6], [0x122c356c, 0x462e75e5], - [0x274bd57d, 0xc40f85c4], [0x601704b2, 0x10a86f33], - [0xf28ee83a, 0x12fab256], [0x321b4d79, 0x3e11bcc3], - [0x5fdc994e, 0x7bcf3fcb], [0x38016483, 0x2c5dfe44], - [0xbe29a429, 0xbf4fa453], [0x50130bb4, 0x6027303b], - [0xe4dcceb1, 0x5844fcb7], [0x48dd9bc1, 0x320c434e], - [0xb478ecc6, 0x69efaa2f], [0xad49a4ff, 0xe5dd1afa], - [0x9c3ce862, 0x14707cd7], [0x4a6588ae, 0x0ecf4354], - [0x542e19db, 0x69188ba4], [0x51a6e537, 0xb5c4bdaf], - [0x55480f0a, 0x1968ba27], [0x67c58376, 0xc1c086a3], [0x076259c3, 0xe291c26c], [0xaee7ac5c, 0xcabdec91], [0x5d3862fb, 0x2e8a3060], [0x6fb3635c, 0x4783593a], [0x13f0eafb, 0x407e486a], [0x7436afdd, 0xd04c4829], @@ -183,77 +63,5 @@ [0xd5fc062a, 0xba74f808], [0x7398cc0a, 0x39a6a269], [0x5581dd60, 0xff79d28c], [0xea5e52b3, 0x9be66c71], [0x8f6e02a4, 0xe27318b5], [0xe8bceb99, 0xa48a7f2c], - [0x1983864a, 0x80a5aaac], [0xc3536829, 0x7394fd57], - [0xb88bee05, 0x98693f0f], [0x7d8a458b, 0xe24e1366], - [0xa9fa5e63, 0x5add82d1], [0xc855bc4b, 0x8921a914], - [0x1308a796, 0x25efdd85], [0x843b5f09, 0x6967d842], - [0x466c5324, 0x414a6b62], [0x02d396d9, 0x716e7aa2], - [0x25da50ce, 0x6d37167a], [0x77caccf4, 0x89676238], - [0xc0ce0f0a, 0xca014c04], [0x526271c8, 0x6473a5d8], - [0xb9b30903, 0x33ca1a9b], [0x73991ad9, 0xdad6ee2b], - [0xe9fded7e, 0xa62e9304], [0x2bdcc821, 0xaefcf4aa], - [0x4767e8c0, 0xfc07e9a8], [0xef2d5991, 0x25e26838], - [0x0280f732, 0xc275aa47], [0xf2d8812d, 0x7b146198], - [0xb3484033, 0xce000bb1], [0x6fde88ea, 0x32a5eaed], - [0xcb5aa54d, 0xe7a7dc62], [0xf6e61717, 0xc80bb539], - [0x9d3fa7fe, 0x8049bb13], [0x5515f524, 0x8d99a313], - [0xe0d58da7, 0x7825c6e9], [0x418e29c0, 0xe3561342], - [0x7416cac5, 0xaca48424], [0xdcce8926, 0xa88eee40], - [0x806afb9f, 0x16acedbf], [0x533d7715, 0x63a675c7], - [0x9698c34e, 0x4246145d], [0x1b244e4f, 0xe6da10bb], - [0x9cb72828, 0x6e5768db], [0xbb12f51c, 0xf7add79d], - [0xaceafb2b, 0x796afb67], [0x779c4e41, 0x22f96d7d], - [0xa48dbeff, 0x91c44711], [0x43504cdd, 0x7cb08d4f], - [0xfa7ed628, 0x2559f274], [0x1a884c3b, 0x74ed2033], - [0x0e726609, 0xfea893aa], [0x716cd1a6, 0x7f9e5fe5], - [0xc67873c7, 0x4bcad23c], [0xcbb64779, 0x2e4aa2e9], - [0x0462bcc0, 0x143db54f], [0x600a7566, 0xac4441c0], - [0x0a6b335a, 0x5c7ecab2], [0xfd76b8da, 0xc4ce6db7], - [0xbc91a726, 0x851c528f], [0x818d13eb, 0x1ca36b12], - [0x9885a5ac, 0x3a098516], [0x61e7242f, 0x1064826f], - [0xd4f7d4b9, 0x3f6f1a22], [0x72c18cf0, 0x82db9137], - [0xcf2cba90, 0xd96ad75d], [0xaf12f199, 0xcd01e204], - [0x00e2abb8, 0x78b39f3c], [0xaf0f9b9b, 0xab02f718], - [0xa7e5d223, 0x20b44deb], [0x77f727b5, 0xd86aa4b8], - [0x20d6a9c6, 0xaf7ac000], [0x90130c05, 0x5d3eda6c], - [0x8b7ac2e7, 0xb14e65da], [0x774c7459, 0x5b5d2e94], - [0xc60a6f87, 0xeb5c9dc6], [0x06b40033, 0x4d4aeb64], - [0xc49eb9ac, 0x01056963], [0x451f30a4, 0xf72585aa], - [0x90bc8094, 0x0b7fc921], [0xe8a1e238, 0x940d40bc], - [0xdf8d4143, 0x078c77d7], [0x79f5acbf, 0x02cc2063], - [0xf0972287, 0x62b66ca1], [0x8294d25d, 0xf0334623], - [0x32bd8c07, 0xe9ad0dca], [0x52d73cc5, 0x2af83f6a], - [0xd5789257, 0xd00fdd3f], [0x0ed4805f, 0x86d2e042], - [0xa8938871, 0x2a451727], [0x4fe809dd, 0xfc0fcea4], - [0x54bdfa74, 0xf74ad2e4], [0xcc50139c, 0x27d182f7], - [0x094bcb80, 0x11882d86], [0x3e2e15be, 0x2eb487ce], - [0xb1cf95c0, 0x482ed5aa], [0x3a73f950, 0x65b816e9], - [0x47678dd2, 0xe0cf3744], [0x259d2212, 0xe49211a7], - [0xf496636f, 0x0eb8d146], [0x0f841214, 0x60037c21], - [0xc9216300, 0x9b36d1fc], [0x01dc3c91, 0x59cc681e], - [0xacda8e5f, 0x06b3a4fd], [0x5d04a561, 0x59b8a3e1], - [0x2f1023a8, 0xaacaf5e2], [0xa7a2a592, 0x60383267], - [0x5685f710, 0xefd7fe80], [0x3063f740, 0x49f2378c], - [0xb5c2bba3, 0xa782e19a], [0xcccdcd9a, 0x79597cb9], - [0x234fba54, 0xd9339f83], [0x65b7823a, 0x457a49ff], - [0x4a5add23, 0xcf7cc6a9], [0xc1e77ed1, 0xba27098d], - [0x1f8c189e, 0x2f5b8023], [0xaf2fffcd, 0x8293128e], - [0x5848ec7b, 0x61158ff8], [0xe0ec6586, 0x0f237678], - [0x0b5589ee, 0xd278bf8c], [0xd0fb87e3, 0x3de30b7d], - [0xc1a930c4, 0x123d49c4], [0x9ab971f8, 0xa838c0af], - [0xfa27b840, 0x9f7e503b], [0x816429d4, 0xc27f0e83], - [0x41212e19, 0xd43f3cbc], [0x0fdf2e66, 0xca39edbd], - [0x0d66bf17, 0xac6591b4], [0x326dbfd5, 0x75333b1b], - [0xdd01e462, 0x83b73d69], [0xcdbdd110, 0x1da44770], - [0xd90b13ed, 0xb7baf1f0], [0xcc0dd031, 0x1f41c7de], - [0xc89a5ccb, 0x5cb1abc7], [0x1f2accd5, 0xc5297bac], - [0x1475293b, 0x024435b5], [0xf13cdd2c, 0xb3ee4315], - [0x8eb6760a, 0xc108d18a], [0x39e5cfd9, 0x5c0f03a8], - [0xb603bb83, 0xf7a6528f], [0x4d68a935, 0x38ad5d4d], - [0x9aace8ef, 0xb187547d], [0xced0a49c, 0x9c88f96e], - [0x6fe5277e, 0x9a37a69b], [0x5d0c42d8, 0x98e64709], - [0x6f3b089c, 0x2dd85892], [0xa1353dae, 0x16b4f0b1], - [0xadbea3a8, 0xf2aeb5d2], [0xcdd96818, 0x7ee6de2c], - [0x94e2c842, 0xd63d566d], [0x1df860c9, 0x3271c625] ); 1; |