21.11.2017, 19:26
Quote:
|
I didn't understand the strcmp myself, but must add that definitely in comparison to other regular hashes, this plugin is faster for confirmation if you want to validate a lot of hashes between themselves.
i.e. Int == Int is faster than Str == Str if you have a lot to compare I think it'd be better to use md5 for anything, but I'd like to see if its faster than y_stringhash they both produce numerical hash which are good for massive comparison, but the question is if it'd be better (faster) to use this plugin over y_stringhash |
Speed test for 10k executings:
Test #1
y_stringhash - 25ms.
MurmurHash - 10ms.
Test #2
y_stringhash - 26ms.
MurmurHash - 10ms.
Test #3
y_stringhash - 25ms.
MurmurHash - 10ms.
Code:
PHP код:
#include <a_samp>
#include <MurmurHash>
#include "YSI_Coding/y_stringhash"
main()
{
new key[] = "This is test string";
new tick = GetTickCount();
for(new i = 0; i < 10000; i++)
{
YHash(key);
}
new tick1 = GetTickCount();
for(new i = 0; i < 10000; i++)
{
MurmurHash(key,sizeof(key),0);
}
new tick2 = GetTickCount();
printf("y_stringhash VS MurmurHash");
printf("y_stringhash took %dms",tick1-tick);
printf("MurmurHash took %dms",tick2-tick1);
}


