09.07.2016, 17:23
[Include] dini2.inc - Improved dini file processor with amazing benchmarks (aka. gini)!
09.07.2016, 20:53
Example
if the file is missing a line, it is not automatically created. In the old version Dini line was created and assigned a value of 0.
It can be a problem only for me =\
Quote:
dini_IntSet(PlayerInfo[playerid][pName]).("GSession",(dini_Int(PlayerInfo[playerid][pName]).("GSession"))+1); |
It can be a problem only for me =\
09.07.2016, 21:01
Quote:
Example
if the file is missing a line, it is not automatically created. In the old version Dini line was created and assigned a value of 0. It can be a problem only for me =\ |
pawn Code:
dini_IntSet(PlayerInfo[playerid][pName], "GSession", dini_Int(PlayerInfo[playerid][pName], "GSession") + 1);
15.07.2016, 17:30
(
Last edited by Yashas; 15/07/2016 at 06:16 PM.
)
Quote:
Theres nothing wrong with this concept, ALOT of scripts out there still use dini, people can just include this instead of dini and speed up their file functions.
Everything must be criticized in this place.. lmao. |
Of course, you will always find me (most of the times) critizing someone because the replies I make which appreciate are very few. I simply don't reply "Good" "Cool" , etc. Sometimes I throw away few reps to satisfy the author if he even cares about them. For Gammix, it might appear that I keep critizing him too often. It is because Gammix keeps releasing something every day and I find faults with it everytime and I just critize it so that it gets improved. Maybe I critize in a mean way or maybe I should change the way I critize. That is what others have to tell rather than complaining that everything is critized in the forums.
Quote:
Y_INI vs. eINI vs. DINI2
If the benchmarks are wrong, you may share yours or correct them, i haven't really used Y_INI or any INI processor. Benchmarks code: pawn Code:
Code:
[15:59:11] [Y_INI] Write string to 10 fields 100000 times -> 2944 ms [15:59:19] [Y_INI] Read string from 10 fields 100000 times -> 8173 ms [15:59:20] [eINI] Write string to 10 fields 100000 times -> 965 ms [15:59:21] [eINI] Read string from 10 fields 100000 times -> 838 ms [15:59:21] [DINI2] Write string to 10 fields 100000 times -> 833 ms [15:59:22] [DINI2] Read string from 10 fields 100000 times -> 870 ms |
2. You just wrote the worst possible code for both YINI and eINI. Both these processors provide section id system which cuts down the speed significantly. Maybe even 10x faster with section ids.
3. Your speed tests don't consider opening/writing time at all. In fact, eINI is slower than YINI while parsing given the fact that eINI provides lot of customizable options, it has to be slow. However, the range of features it provides will circumvent the speed loss. In fact, eINI writes and reads faster which compensates for the speed loss while opening the file.
4. YINI and eINI provide dynamic loading system which will just throw your system out of the competition.
5. eINI provides keyid system too which if used could be even 20x faster than YINI but that would be cheating because not everybody knows how to use it and most people would not use it. So the mainstream competition should remain within normal Read/Write functions but there should be at least reasonable optimizations.
If you were to implement those features in your Improved DINI. You can't even call it improved DINI. It would simply be a new INI processor.
I can't do proper speed test so all my new speed claims in this reply are mere guesses.
At first the situation was, gini was slow and did not have enough features. Even though you called it an update for dini it wasn't still worth it. People had to switch to SQL or a new INI processor. Now with your str(un)pack removed, gini meets eINI and YINI when the worst possible code of eINI and YINI is used.
Frankly, I don't want to hurt your feelings but you have too much ego. You are don't like critizisim for some reason. Sometimes you keep arguing about the same thing again and again in spite of best efforts of many to convience you.
I just saw a post where Crayder said the very same thing which I had already told you at least 5 times with big explaination that "you CANNOT add prints/formats/etc inside speed test code". With your logic I can prove that dini is as fast as eINI. I will add 100000 printfs inside the speed test loop and prove that eINI takes 1000ms and dini takes 1001ms so they are almost the same. You say that everytime there has to be code inside becaz its practical but that is not true with speed tests.
If you add just one/two printf inside the command, you will find that ZCMD comes close to IZCMD and you may even conclude that they are the same.
In fact, all performance optimizations loose their meaning if you do speed tests that way beause every optimization will appear to be negligible.
If you still don't know why, get a course on debugging & testing. I am not sure if you are a teen or doing your engineering in CS but anyway the best thing for you right now is to check testing docs and procedures.
15.07.2016, 19:22
In my previous replies i told you why i don't want to make another INI processor; "Waste of time". "You can judge by the number of users eINI have." eINI is the newest one out there, faster than DINI and YINI but people still stick with DINI who are using old scripts or are unaware and others are satisfied with YINI. So you should have realized by now there is no point in inventing something new, so i decided to atleast improve upon DINI with my DINI2 which i find people have started using.
Instead of just speaking of my wrong coding practice, share some of your code which i'll find useful and better in ways.
And why would you consider old arguments here?
Trying to be sarcastic?
(i never expressed myself rude against your criticism unless you were provocative)
Instead of just speaking of my wrong coding practice, share some of your code which i'll find useful and better in ways.
And why would you consider old arguments here?
Trying to be sarcastic?
(i never expressed myself rude against your criticism unless you were provocative)
21.07.2016, 18:57
Is that faster than this https://sampforum.blast.hk/showthread.php?tid=581453
21.07.2016, 19:10
I don't think so, INI processors never been, never will be faster than SQL.
26.07.2016, 16:02
Gammix i'm want use dini2 in lethaldudb2 (http://pastebin.com/UwsfdScb) but i have problem
You may help or sync dini2 witch lethaldudb2 ?
Quote:
udb_RenameUser(oldname,newname); (use frenametextfile) - old acc not delete |
Quote:
line format - dUserSetINT(PlayerInfo[playerid][pName]).("TOS",(dUserINT(PlayerInfo[playerid][pName]).("TOS"))+1); - not change parameter "TOS" in player (syntax not help) |
27.07.2016, 04:39
Quote:
Gammix i'm want use dini2 in lethaldudb2 (http://pastebin.com/UwsfdScb) but i have problem
You may help or sync dini2 witch lethaldudb2 ? |
14.11.2016, 14:56
Update v2.3.3:
- Improved timeout config, now the include will timeout index 0 file when more than "INI_MAX_INSTANCES" files are opened.
- Decreased timeout limit, was unnecessarily high upto 1000!
- Improved timeout config, now the include will timeout index 0 file when more than "INI_MAX_INSTANCES" files are opened.
- Decreased timeout limit, was unnecessarily high upto 1000!
14.11.2016, 18:17
bug frenametextfile, not removed old files
14.11.2016, 18:30
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);
}
29.11.2016, 12:47
Nice, thx.
29.11.2016, 12:49
(
Последний раз редактировалось Vadyanga; 29.11.2016 в 13:38.
)
Quote:
dini_UnSet(const file[], const field[]); dini_IsSet(const file[], const field[]); |
02.12.2016, 12:08
(
Последний раз редактировалось Zorono; 02.12.2016 в 14:24.
)
Nice work but i have mini proplem, 'Unfined symbol 'dini_Isset' please help
Edit: solved, sorry it was my fualt becuse on old Dini it was lowercase charecters function but on gini it was capital
Edit: solved, sorry it was my fualt becuse on old Dini it was lowercase charecters function but on gini it was capital
13.12.2016, 17:36
idk why but dini_Int and dini_Float work incorrect.
dini_Int get bad value.
dini_Int get bad value.
14.12.2016, 13:22
14.12.2016, 17:06
Nope i don't have any spaces in file.
++ if player not registered, dini_Int automatically create file with -1 values
Look at JokeyL.ini
Example of using:
Use in OnPlayerDeath:
playerInfo[killerid][Kills] += 1;
Load:
playerInfo[playerid][Kills] = dini_Int(path, "pKills");
Save:
dini_IntSet(path, "pKills", playerInfo[playerid][Kills]);
++ if player not registered, dini_Int automatically create file with -1 values
Look at JokeyL.ini
Код:
pLogged=1 pScore=-1 pCash=-1 pKills=-1 pDeaths=-1 pVisits=-1
Use in OnPlayerDeath:
playerInfo[killerid][Kills] += 1;
Load:
playerInfo[playerid][Kills] = dini_Int(path, "pKills");
Save:
dini_IntSet(path, "pKills", playerInfo[playerid][Kills]);
15.12.2016, 03:55
Quote:
Nope i don't have any spaces in file.
++ if player not registered, dini_Int automatically create file with -1 values Look at JokeyL.ini Код:
pLogged=1 pScore=-1 pCash=-1 pKills=-1 pDeaths=-1 pVisits=-1 Use in OnPlayerDeath: playerInfo[killerid][Kills] += 1; Load: playerInfo[playerid][Kills] = dini_Int(path, "pKills"); Save: dini_IntSet(path, "pKills", playerInfo[playerid][Kills]); |
I'll make an update plus some optimizations.
« Next Oldest | Next Newest »
Users browsing this thread: 3 Guest(s)