-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change hash function gives up to 22% speedup #14
base: master
Are you sure you want to change the base?
Conversation
change hash function to simple and fast *31 function 22% speedup
added benchmark for generate 5000 perfect numbers
fix compile error
really up to 3% speedup
compact code, one module uses. speed up really to 22%
calc hash and compare with hashed values
Wow! Is the 22% speedup affects the entire library when executing JS code? |
and change copy of standard functions to original
not always. 3%-10% speedup when executing JS code. |
.Name = .Name +can be changed to add widechars to array and then fast copy to .Name at finish of cycle |
Why just assembler? :) function ShaPerfectHashStr(const s: RawByteString): integer;
var
i: integer;
begin;
Result:=0;
for i:=0 to Length(s)-1 do Result:=(Result + ord(s[i+1]) + 1507220783) * 1041204193;
end; Well, and assembler :) |
A few words about Aleksandr Sharahov. See Fastcode Winner's List Overview |
my hash function is simpler and faster h:=ord(Key[1]); result:=h; |
@tigrazone |
yes! it's X31Hash. same function used in TFPHashList |
Well, then the FP developers also do not respect the merits and work of other people. @BeRo1985 don't merge this PR, please. |
No description provided.