SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 09/07/2016, 06:23 PM   #21
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,689
Reputation: 671
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Quote:
Originally Posted by Dalayma View Post
dini_IntSet does not work
Its working well for me, can you show your code and file where it gets saved.
__________________
Gammix is online now   Reply With Quote
Old 09/07/2016, 09:53 PM   #22
Dalayma
Little Clucker
 
Join Date: Oct 2015
Posts: 17
Reputation: 0
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Example
Quote:
dini_IntSet(PlayerInfo[playerid][pName]).("GSession",(dini_Int(PlayerInfo[playerid][pName]).("GSession"))+1);
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 =\
Dalayma is offline   Reply With Quote
Old 09/07/2016, 10:01 PM   #23
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,689
Reputation: 671
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Quote:
Originally Posted by Dalayma View Post
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 =\
That's not the right syntax, here is how it should be: (this is the original DINI syntax)
Code:
dini_IntSet(PlayerInfo[playerid][pName], "GSession", dini_Int(PlayerInfo[playerid][pName], "GSession") + 1);
__________________
Gammix is online now   Reply With Quote
Old 15/07/2016, 06:30 PM   #24
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 882
Reputation: 266
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Quote:
Originally Posted by Kar View Post
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.
Everything must be criticized when required because SAMP is a community driven project. I always accept critics browsing through my threads and their replies because they are constructive.

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:
Originally Posted by Gammix View Post
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:
Code:
#include <a_samp>

#include <YSI\y_ini>

#include <eini>

#define INI_FILE_TIMEOUT (3000)
#include <dini2>

main()
{
	new s, e;

	// Y_INI
	// Writing
	s = GetTickCount();

	new INI:handle = INI_Open("Test.ini");
	for (new i; i < 100000; i++)
	{
	    INI_WriteString(handle, "Set1", "Gammix_Changed");
	    INI_WriteString(handle, "Set2", "Gammix_Changed");
	    INI_WriteString(handle, "Set3", "Gammix_Changed");
	    INI_WriteString(handle, "Set4", "Gammix_Changed");
	    INI_WriteString(handle, "Set5", "Gammix_Changed");
	    INI_WriteString(handle, "Set6", "Gammix_Changed");
	    INI_WriteString(handle, "Set7", "Gammix_Changed");
	    INI_WriteString(handle, "Set8", "Gammix_Changed");
	    INI_WriteString(handle, "Set9", "Gammix_Changed");
	    INI_WriteString(handle, "Set10", "Gammix_Changed");
	}
	INI_Close(handle);

	e = GetTickCount();
	printf("[Y_INI] Write string to 10 fields 100000 times -> %i ms", e - s);

	// Reading
	s = GetTickCount();

	for (new i; i < 100000; i++)
	{
        INI_ParseFile("Test.ini", "LoadFile");
	}

	e = GetTickCount();
	printf("[Y_INI] Read string from 10 fields 100000 times -> %i ms", e - s);



	// eINI
	// Writing
	s = GetTickCount();

	handle = INI::OpenINI("Test2.ini", INI_WRITE);
	for (new i; i < 100000; i++)
	{
	    INI::WriteString(handle, "Gammix_Changed", "Set1", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set2", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set3", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set4", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set5", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set6", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set7", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set8", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set9", "");
	    INI::WriteString(handle, "Gammix_Changed", "Set10", "");
	}
	INI::CloseINI(handle);

	e = GetTickCount();
	printf("[eINI] Write string to 10 fields 100000 times -> %i ms", e - s);

	// Reading
	s = GetTickCount();

	handle = INI::OpenINI("Test2.ini", INI_READ);
	for (new i; i < 100000; i++)
	{
	    INI::ReadString(handle, "", "Set1", "");
	    INI::ReadString(handle, "", "Set2", "");
	    INI::ReadString(handle, "", "Set3", "");
	    INI::ReadString(handle, "", "Set4", "");
	    INI::ReadString(handle, "", "Set5", "");
	    INI::ReadString(handle, "", "Set6", "");
	    INI::ReadString(handle, "", "Set7", "");
	    INI::ReadString(handle, "", "Set8", "");
	    INI::ReadString(handle, "", "Set9", "");
	    INI::ReadString(handle, "", "Set10", "");
	}

	e = GetTickCount();
	printf("[eINI] Read string from 10 fields 100000 times -> %i ms", e - s);
	


	// DINI2
	// Writing
	s = GetTickCount();

	dini_Create("Test3.ini");
	for (new i; i < 100000; i++)
	{
	    dini_Set("Test3.ini", "Set1", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set2", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set3", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set4", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set5", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set6", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set7", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set8", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set9", "Gammix_Changed");
	    dini_Set("Test3.ini", "Set10", "Gammix_Changed");
	}
	dini_Timeout("Test3.ini");

	e = GetTickCount();
	printf("[DINI2] Write string to 10 fields 100000 times -> %i ms", e - s);
	
	// Reading
	s = GetTickCount();

	dini_Create("Test3.ini");
	for (new i; i < 100000; i++)
	{
	    dini_Get("Test3.ini", "Set1");
	    dini_Get("Test3.ini", "Set2");
	    dini_Get("Test3.ini", "Set3");
	    dini_Get("Test3.ini", "Set4");
	    dini_Get("Test3.ini", "Set5");
	    dini_Get("Test3.ini", "Set6");
	    dini_Get("Test3.ini", "Set7");
	    dini_Get("Test3.ini", "Set8");
	    dini_Get("Test3.ini", "Set9");
	    dini_Get("Test3.ini", "Set10");
	}
	dini_Timeout("Test3.ini");

	e = GetTickCount();
	printf("[DINI2] Read string from 10 fields 100000 times -> %i ms", e - s);
}

forward LoadFile(tag[],key[],value[]);
public LoadFile(tag[],key[],value[])
{
}

Results:
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
@Yashas: I guess you were wrong on you claiming this WAY WAY WAY slower. Its alot faster than YINI and step further than eINI even with such syntax it supports.
1. When I claimed that gini is WAY slower you had 123218743987593479535 strunpack and strpacks. Do the test with your old version and you will find it to be WAY WAY slower.
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.

Last edited by Yashas; 15/07/2016 at 07:16 PM.
Yashas is offline   Reply With Quote
Old 15/07/2016, 08:22 PM   #25
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,689
Reputation: 671
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Quote:
Originally Posted by Yashas View Post
...
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)
__________________
Gammix is online now   Reply With Quote
Old 21/07/2016, 07:57 PM   #26
Sioux
Little Clucker
 
Join Date: Jul 2013
Location: Bosna i Hercegovina
Posts: 9
Reputation: 2
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Is that faster than this http://forum.sa-mp.com/showthread.php?t=581453
Sioux is offline   Reply With Quote
Old 21/07/2016, 08:10 PM   #27
iKarim
Huge Clucker
 
Join Date: Oct 2015
Posts: 480
Reputation: 82
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

I don't think so, INI processors never been, never will be faster than SQL.
iKarim is offline   Reply With Quote
Old 26/07/2016, 05:02 PM   #28
Dalayma
Little Clucker
 
Join Date: Oct 2015
Posts: 17
Reputation: 0
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Gammix i'm want use dini2 in lethaldudb2 (http://pastebin.com/UwsfdScb) but i have problem

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)
You may help or sync dini2 witch lethaldudb2 ?
Dalayma is offline   Reply With Quote
Old 27/07/2016, 05:39 AM   #29
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,689
Reputation: 671
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

Quote:
Originally Posted by Dalayma View Post
Gammix i'm want use dini2 in lethaldudb2 (http://pastebin.com/UwsfdScb) but i have problem




You may help or sync dini2 witch lethaldudb2 ?
I tested the code with dini2 and it works flawless. Just replace <dini> with <dini2>.
__________________
Gammix is online now   Reply With Quote
Old 14/11/2016, 03:56 PM   #30
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,689
Reputation: 671
Default Re: gini.inc - Fast multi file processor with "dini's" syntax

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!
__________________
Gammix is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [I-ZCMD]Improved ZCMD - Fastest Command Processor Yashas Includes 99 23/07/2017 05:23 PM
[Off] Dini2? yurin Português/Portuguese 5 27/11/2016 03:09 AM
[Include] eXtended INI Processor - Fast & Feature Rich INI Processor Yashas Includes 28 01/09/2015 08:45 PM
[INC+FS] Aero File Processor by Luby * Updated! luby Filterscripts 15 14/05/2009 02:07 PM


All times are GMT. The time now is 02:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.