Performance of getkey & setkey
-
Marco
- Posts: 2354
- Joined: 27 Jun 2011 15:20
Performance of getkey & setkey
I was wondering if calling getkey two times on the same ini file triggers a read action twice.
If so, maybe that could be improved allowing getkey to work on variables containing the ini file, so that all operations are done in ram.
Same for setkey...
If so, maybe that could be improved allowing getkey to work on variables containing the ini file, so that all operations are done in ram.
Same for setkey...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Performance of getkey & setkey
That is: you explicitely want to read/write the file to/from variable, and getkey/setkey should allow to specify the variablename instead of the filename?
PS: thinking about this it seems it would be of use for me, too!
PS: thinking about this it seems it would be of use for me, too!
-
Marco
- Posts: 2354
- Joined: 27 Jun 2011 15:20
Re: Performance of getkey & setkey
Getkey/setkey should allow to operate on a variable stored in ram instead that an ini file on disk. A variable that contains what an ini file contains, of course.
Benefit: no disk i/o operations apart from the very first read (file to memory) and the very last write (memory to file). You would also save cell life on SSD.
Benefit: no disk i/o operations apart from the very first read (file to memory) and the very last write (memory to file). You would also save cell life on SSD.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Performance of getkey & setkey
*g* A good SSD should allow 60 TB+ writes so I hope it doesn't die from writing config filesYou would also save cell life on SSD.
+1 for this feature wish!
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 67314
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Performance of getkey & setkey
Just for info...
I thought 60 times (different) setkey-commands to xyplorer.ini would be a bit of work. But as I see it this is done in about 1 sec! (Maybe faster: date('hh:mm:ss') often sees the same second before and after.) I'd say it's hardly to notice...
So for me it's okay how it works now
I think it would only be interesting if you either have much more setkey to the same file, or a much bigger ini-file.
Just for interest: does somebody have?
I thought 60 times (different) setkey-commands to xyplorer.ini would be a bit of work. But as I see it this is done in about 1 sec! (Maybe faster: date('hh:mm:ss') often sees the same second before and after.) I'd say it's hardly to notice...
So for me it's okay how it works now
I think it would only be interesting if you either have much more setkey to the same file, or a much bigger ini-file.
Just for interest: does somebody have?
-
admin
- Site Admin
- Posts: 67314
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Performance of getkey & setkey
You could also read the file and parse it yourself.
FAQ | XY News RSS | XY X
-
PeterH
- Posts: 2830
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Performance of getkey & setkey
Try to emulate $value = getkey($key, $sect, $file); (or alike) with a script.admin wrote:You could also read the file and parse it yourself.
So we would need functions, parameters, and return values
And I don't know how fast this could be then
-
Marco
- Posts: 2354
- Joined: 27 Jun 2011 15:20
Re: Performance of getkey & setkey
I don't have big ini files to test, but maybe there's some underlying caching, who knows...PeterH wrote:Just for info...
I thought 60 times (different) setkey-commands to xyplorer.ini would be a bit of work. But as I see it this is done in about 1 sec! (Maybe faster: date('hh:mm:ss') often sees the same second before and after.) I'd say it's hardly to notice...
So for me it's okay how it works now
I think it would only be interesting if you either have much more setkey to the same file, or a much bigger ini-file.
Just for interest: does somebody have?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
Filehero
- Posts: 2734
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
SC getkey(): support for "memory-mapped" INI-"files"?
Hi Don,
I wonder how much effort it would be to make SC getkey() supporting "INI-files in memory" (sorry, havent't found better words for it)?
I mean something like
Though this "idea" comes from thinking about establishing a more "typed" way for passing back results when using SC runret(), wouldn't it in the end be nothing else then a simple implementation of Hashmaps/Dictionaries?
Hmm...
Cheers,
Filehero
I wonder how much effort it would be to make SC getkey() supporting "INI-files in memory" (sorry, havent't found better words for it)?
I mean something like
Code: Select all
$INI = <<<INI
[Name]
first_name=File
name=Hero
INI;
msg(getkey("first_name", "Name", "$INI"));Hmm...
Cheers,
Filehero
-
Marco
- Posts: 2354
- Joined: 27 Jun 2011 15:20
Re: SC getkey(): support for "memory-mapped" INI-"files"?
I asked the same roughly one year ago, but the answer wasn't positive. I hope time has changed in a good way...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
Filehero
- Posts: 2734
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: SC getkey(): support for "memory-mapped" INI-"files"?
Hi Marco,
did you find the link to that old post?Marco wrote:I asked the same roughly one year ago, but the answer wasn't positive. I hope time has changed in a good way...
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: SC getkey(): support for "memory-mapped" INI-"files"?
It's the same as the one you posted in.Filehero wrote:Hi Marco,did you find the link to that old post?Marco wrote:I asked the same roughly one year ago, but the answer wasn't positive. I hope time has changed in a good way...
EDIT: Although now I'm having doubts about the merger since the topic is really about performance.
-
Filehero
- Posts: 2734
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: SC getkey(): support for "memory-mapped" INI-"files"?
I do share your doubts.TheQwerty wrote:EDIT: Although now I'm having doubts about the merger since the topic is really about performance.
-
admin
- Site Admin
- Posts: 67314
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Performance of getkey & setkey
No, time has not changed anything: forget it. 
FAQ | XY News RSS | XY X
XYplorer Beta Club