24.03.2012, 08:29
Nice.. But I got an other result for testing.
the test script.
Код:
[09:32:17] Loading filterscript 'test.amx'... [09:32:17] SII write started [09:32:17] SII test done in 196 [09:32:17] HSA write started [09:32:18] HSA test done in 391 [09:32:18] SII read started [09:32:18] SII test done in 84 [09:32:18] this is a short string 1234567890 0.123400 [09:32:18] HSA read started [09:32:18] HSA test done in 145 [09:32:18] this is a short string 1234567890 0.123450 [09:32:18] Loaded 1 filterscripts.
Код:
#include <a_samp> #include <sii> #include <hsa> #define TEST_TIME 100 public OnFilterScriptInit() { new tick = GetTickCount(); print("SII write started"); for(new i = 0; i < TEST_TIME; i++) { INI_Open("sii.ini"); INI_WriteString("string", "this is a short string"); INI_WriteInt("int", 1234567890); INI_WriteFloat("float", 0.12345); INI_Save(); INI_Close(); } printf("SII test done in %d\n", GetTickCount() - tick); tick = GetTickCount(); print("HSA write started"); for(new i = 0; i < TEST_TIME; i++) { setString:"hsa"("string", "this is a short string"); setInt:"hsa"("int", 1234567890); setFloat:"hsa"("float", 0.12345); } printf("HSA test done in %d\n", GetTickCount() - tick); new rstring[256], rint, Float:rfloat; tick = GetTickCount(); print("SII read started"); for(new i = 0; i < TEST_TIME; i++) { INI_Open("sii.ini"); INI_ReadString(rstring, "string"); rint = INI_ReadInt("int"); rfloat = INI_ReadFloat("float"); INI_Close(); } printf("SII test done in %d\n", GetTickCount() - tick); printf("%s %d %f\n", rstring, rint, rfloat); rstring[0] = EOS; rint = 0; rfloat = 0.0; tick = GetTickCount(); print("HSA read started"); for(new i = 0; i < TEST_TIME; i++) { format(rstring, sizeof(rstring), "%s", getString:"hsa"("string")); rint = getInt:"hsa"("int"); rfloat = getFloat:"hsa"("float"); } printf("HSA test done in %d\n", GetTickCount() - tick); printf("%s %d %f\n", rstring, rint, rfloat); return 1; }