Performance of getkey & setkey

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Performance of getkey & setkey

Post by Marco »

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...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
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

Post by PeterH »

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!

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Performance of getkey & setkey

Post by Marco »

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.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
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

Post by highend »

You would also save cell life on SSD.
*g* A good SSD should allow 60 TB+ writes so I hope it doesn't die from writing config files :)

+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:

Re: Performance of getkey & setkey

Post by admin »

Forget it. Impossible.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Performance of getkey & setkey

Post by PeterH »

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 :D

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

Post by admin »

You could also read the file and parse it yourself.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Performance of getkey & setkey

Post by PeterH »

admin wrote:You could also read the file and parse it yourself.
Try to emulate $value = getkey($key, $sect, $file); (or alike) with a script. :?
So we would need functions, parameters, and return values :P

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

Post by Marco »

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 :D

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 don't have big ini files to test, but maybe there's some underlying caching, who knows...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
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"?

Post by Filehero »

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

Code: Select all

$INI = <<<INI
[Name]
first_name=File
name=Hero
INI;

  msg(getkey("first_name", "Name", "$INI"));
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

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: SC getkey(): support for "memory-mapped" INI-"files"?

Post by Marco »

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]

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SC getkey(): support for "memory-mapped" INI-"files"?

Post by Filehero »

Hi Marco,
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...
did you find the link to that old post?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: SC getkey(): support for "memory-mapped" INI-"files"?

Post by TheQwerty »

Filehero wrote:Hi Marco,
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...
did you find the link to that old post?
It's the same as the one you posted in. ;)

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"?

Post by Filehero »

TheQwerty wrote:EDIT: Although now I'm having doubts about the merger since the topic is really about performance. :?
I do share your doubts. :mrgreen:

admin
Site Admin
Posts: 67314
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Performance of getkey & setkey

Post by admin »

No, time has not changed anything: forget it. :)

Post Reply