change hash function gives up to 22% speedup - #14
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.