mIRC Home    About    Download    Register    News    Help

Print Thread
#183871 23/08/07 08:41 AM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
I have a file called piker.ini which contains several settings for my script. My question is, is the .ini file loaded when mirc starts and remains whole in the memory or is it called when needed and that's it?


piker #183874 23/08/07 09:40 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
An ini file is not stored in memory.

Only when you tell mIRC to read ($readini) from the file, you're getting information returned. After that it is up to you what you do with that information. If you save the information to a variable, it will obviously be in memory.

So, nothing is being loaded, unless you tell mIRC to.

OrionsBelt #183875 23/08/07 09:55 AM
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Once the information is read, it is cached for a period of time, based on Windows inbuilt INI routines.

OrionsBelt #183876 23/08/07 10:12 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Well, mIRC states to cache ini files. There is also that /flushini command:
Quote:
/flushini <filename>
Flushes the specified INI file to the hard disk. INI files are cached in memory, so you may want to do this to make sure that your INI is updated properly.

I wondered how long and how much of ini data will be "cached in memory".
Of course mIRC will not "load" or "cache" your ini files on its own, as OrionsBelt pointed out. The inidata is storad as "physical" file.

Somewhere I read there is one, but I'm not able to reproduce a measurable time offset between first read attempt of a (large custom) inifile and further read attempts with a script. Maybe someone can clarify this?
Thanks. smile

EDIT: ok, after some time and/or using a "ram defrag" tool, there is a measurable difference:
Code:
//var %start = $ticks | echo -a read: $ini($mircini,20) | echo -a $calc($ticks - %start) ticks
or
Code:
//var %start = $ticks | echo -a read: $readini(servers.ini,$ini(servers.ini,2),n0) | echo -a $calc($ticks - %start) ticks

first attempt: 15, 30 or even 120 ticks
second attempt: 0 ticks

Last edited by Horstl; 23/08/07 10:55 AM.
Horstl #183965 24/08/07 01:13 AM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
Thanks for your reply that answered exactly what I was after.



Link Copied to Clipboard