Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a73164

Browse files
committed
Improve set of candidate multipliers for perfect hash function generation
The previous set of multipliers was not adapted for large sets of shortkeys, and this new set of multipliers allows to generate perfect hashfunctions for larger sets without having an impact for existing callersof those functions, as experimentation has showed. A future commit willmake use of that to improve the performance of unicode normalization.All multipliers compile to shift-and-add instructions on most platforms.This has been tested as far back as gcc 4.1 and clang 3.8.Author: John NaylorReviewed-by: Mark Dilger, Michael PaquierDiscussion:https://postgr.es/m/CACPNZCt4fbJ0_bGrN5QPt34N4whv=mszM0LMVQdoa2rC9UMRXA@mail.gmail.com
1 parent9868167 commit2a73164

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/tools/PerfectHash.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ sub generate_hash_function
8181
# to calculate via shift-and-add, so don't change them without care.
8282
# (Commonly, random seeds are tried, but we want reproducible results
8383
# from this program so we don't do that.)
84-
my$hash_mult1 =31;
84+
my$hash_mult1 =257;
8585
my$hash_mult2;
8686
my$hash_seed1;
8787
my$hash_seed2;
8888
my@subresult;
8989
FIND_PARAMS:
90-
foreach (127, 257, 521, 1033, 2053)
90+
foreach (17, 31, 127, 8191)
9191
{
9292
$hash_mult2 =$_;# "foreach $hash_mult2" doesn't work
9393
for ($hash_seed1 = 0;$hash_seed1 < 10;$hash_seed1++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp