Archive: How to speed up writing data to ini (or how to read/write from memory)


How to speed up writing data to ini (or how to read/write from memory)
Hello,
I am using in my NSIS script a custom pages created using InstallOptions plugin.
Before the custom page is created and displayed I write to ini file some information, that this page using to display. There is one problem with it. Speed.
One of my pages have a treeview component, that have a lot of items (about 700). I use languages in installer. So, to create a page I have to write to ini some informations depending on choosed interface language.
Writing this values to ini tooks to long. Is there any way to speed it up? (I use ReserveFile).
Is there any possibility to write data to memory? And then read it from there? Is there any plugin that
can do it for me? (I mean a lot of text, ini file structure in memory).
Thanks,
-Pawel


If you are up to it, switch to nsDialogs instead of InstallOptions.
It speeds complex dialogs up immensely.


Originally posted by Sheik
If you are up to it, switch to nsDialogs instead of InstallOptions.
It speeds complex dialogs up immensely.
Thanks, I am sure nsDialogs are much faster, but I have to store the data in some place. As I understand nsdialogs lets creating pages, but cant store for example items of treeview.
To do it, I need to write/read from file with data (treeview is created by my own plugin) - and it is to slow.
So, this is why I am thinking to use memory instead of ini files. But, how can I write to memory large blocks of data (with ini structure) and then read from there by plugin (and vice versa)... Don't know is it possibly.
Regards,
-Pawel

You can either store the items on the stack (makes it easy to access the items in your plugin) or you could use the NSISArray plugin to store them in an array...


Originally posted by PepeSoft
So, this is why I am thinking to use memory instead of ini files. But, how can I write to memory large blocks of data (with ini structure) and then read from there by plugin (and vice versa)... Don't know is it possibly.
You could try my NSISList plugin now to store the items:
http://nsis.sourceforge.net/NSISList_plug-in

My test has shown that you can create 100 lists and add 10.000 strings to each list without problem. So you can store 1 million strings (maybe even more) entirely in memory with that plugin. I guess that should be enough for your tree view...

Originally posted by LoRd_MuldeR
You could try my NSISList plugin now to store the items:
http://nsis.sourceforge.net/NSISList_plug-in
Thanks, i will try this. For now, I am trying to work with NSISarray by Stu.
Regards