15.11.2016, 22:35
Quote:
The first test is writing a single INI file with 1,000,000 lines. The second test is more accurately testing writing a single file with 10 lines. It is the same with reading:
Open the file ONCE. Parse the file ONCE. Read some easy variables a load of times. The thing you need to be timing is "INI::OpenINI". That is the slow part, and that is why y_ini's reading was so much slower: pawn Код:
|
I have made a new speed test above: (I am not even touching the redaing part for YINI and it slower already according to the test if it's done right)
Result:
PHP код:
[18:20:51] 6134 ms
[18:21:02] 10922 ms
PHP код:
#include <a_samp>
#include <dini2>
#include <YSI\y_ini>
main()
{
new s, e;
s = GetTickCount();
for (new i; i < 100000; i++)
{
dini_Get("Test1.ini", "Set1");
dini_Int("Test1.ini", "Set2");
dini_Float("Test1.ini", "Set3");
dini_Timeout("Test1.ini");
}
e = GetTickCount();
printf("%i ms", e-s);
s = GetTickCount();
for (new i; i < 100000; i++)
{
INI_ParseFile("Test2.ini", "LoadFile");
}
e = GetTickCount();
printf("%i ms", e-s);
}
Quote:
Your eINI code is more similar to your DINI2 code, but again because you are doing the hard part only once, any real differences get lost in the noise.
Again: I don't know if this system truly is faster because your tests don't show anything meaningful. You skip the hard work in some tests, repeat it in others, then claim that the first test was faster - of course it is! |
Result:
PHP код:
[18:29:10] 6182 ms
[18:29:18] 7756 ms
PHP код:
#include <a_samp>
#include <dini2>
#include <eINI>
main()
{
new s, e;
s = GetTickCount();
for (new i; i < 100000; i++)
{
dini_Get("Test1.ini", "Set1");
dini_Int("Test1.ini", "Set2");
dini_Float("Test1.ini", "Set3");
dini_Timeout("Test1.ini");
}
e = GetTickCount();
printf("%i ms", e-s);
s = GetTickCount();
new INI:handle, read;
for (new i; i < 100000; i++)
{
handle = INI::OpenINI("Test1.ini", INI_READ);
INI::ReadString(handle, "", "Set1", "");
INI::ReadInteger(handle, read, "Set2", "");
INI::ReadFloat(handle, Float:read, "Set3", "");
INI::CloseINI(handle);
}
e = GetTickCount();
printf("%i ms", e-s);
}