02-27-2011, 01:41 PM
As I didn't believe iou his "0.2 seconds vs 0.01 second" comparision, I quickly wrote up a testing script that stores a string, an integer and a float, and removes them afterwards. The first 3 tests were done with looping 1000 times, the last 3 I looped 10.000 times. As I expected, y_ini and dini are actually almost equally fast with less data yet MySQL is faster with more data.
The results:
Looping 1000 times:
Looping 10.000 times:
The code I used to test this:
The results:
Looping 1000 times:
Code:
[13:20:43] It took 4061 milli seconds to save the data using Y_ini!
[13:20:47] It took 4207 milli seconds to save the data using MySQL!
[13:21:43] It took 4632 milli seconds to save the data using Y_ini!
[13:21:47] It took 4056 milli seconds to save the data using MySQL!
[13:22:46] It took 4350 milli seconds to save the data using Y_ini!
[13:21:47] It took 4056 milli seconds to save the data using MySQL!Looping 10.000 times:
Code:
[13:26:02] It took 64192 milli seconds to save the data using Y_ini!
[13:26:42] It took 40249 milli seconds to save the data using MySQL!
[13:28:35] It took 47894 milli seconds to save the data using Y_ini!
[13:29:14] It took 39851 milli seconds to save the data using MySQL!
[13:32:15] It took 60405 milli seconds to save the data using Y_ini!
[13:33:03] It took 47818 milli seconds to save the data using MySQL!The code I used to test this:
Code:
main()
{
new iStart = GetTickCount();
for(new i = 0; i < 10000; i++)
{
new INI:fIni = INI_Open("test.ini");
INI_WriteString(fIni, "foo", "Matthias");
INI_WriteInt(fIni, "bar", 42);
INI_WriteFloat(fIni, "bla", 3.14);
INI_Close(fIni);
fIni = INI_Open("test.ini");
INI_RemoveEntry(fIni, "foo");
INI_RemoveEntry(fIni, "bar");
INI_RemoveEntry(fIni, "bla");
INI_Close(fIni);
}
new iEnd = GetTickCount();
new iRunTime = (iEnd - iStart);
printf("It took %d milli seconds to save the data using Y_ini!", iRunTime);
iStart = GetTickCount();
for(new i = 0; i < 10000; i++)
{
mysql_init();
mysql_connect("localhost", "root", "password", "database");
mysql_query("INSERT INTO samp (foo, bar, bla) VALUES ('Matthias', '42', '3.14')");
mysql_query("DELETE FROM samp WHERE foo = 'Matthias'");
mysql_close();
}
iEnd = GetTickCount();
iRunTime = (iEnd - iStart);
printf("It took %d milli seconds to save the data using MySQL!", iRunTime);
}