| View previous topic :: View next topic |
| Author |
Message |
philz
Joined: 05 Jun 2007 Posts: 87 Location: USA
|
Posted: Thu Jun 14, 2007 3:09 pm Post subject: Can i speed up inireads |
|
|
i have notices that if i do many consecutive ini reads before creating a gui, my exe takes forever (4+ seconds) to display the gui so i conclude that it is likely that the inireads are causing the problem. i would do about 30 inireads and i have about 30 lines of gui. i don't have the script with me at this time so im not entirely sure of the number of lines. but i do remember that cutting some inireads greatly sped up the loading of the gui.
can i still take neumerous pieces of data from an ini file like that and do it quickly? |
|
| Back to top |
|
 |
foom
Joined: 19 Apr 2006 Posts: 386
|
Posted: Thu Jun 14, 2007 5:37 pm Post subject: |
|
|
Make sure you didn't leave a sleep somewhere between the lines.
This happend to me as i debugged my settings loading routine with sleep and tooltip. 30 inireads shouldn't take that long. |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5068 Location: imaginationland
|
Posted: Thu Jun 14, 2007 6:55 pm Post subject: |
|
|
IniRead opens and closes files each time which makes it very slow. You can avoid this by making the DllCalls yourself or switching to a better data storage system like the registry, XML or SQLite. _________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 901
|
Posted: Thu Jun 14, 2007 7:47 pm Post subject: |
|
|
| If IniRead is really that slow, Loop, Read might be worth considering. At least doesn't have to open and close the file for each line. You could still use IniWrite to save settings, since you presumably don't need to do that as often. |
|
| Back to top |
|
 |
philz
Joined: 05 Jun 2007 Posts: 87 Location: USA
|
Posted: Thu Jun 14, 2007 8:32 pm Post subject: |
|
|
| tks guys that's kinda what i thought |
|
| Back to top |
|
 |
|