Page 1 of 1
Speed for dialog
Posted: Wed Jun 22, 2011 1:23 pm
by skiman
Hi,
I have a dialog with 50 objects. At start I want to show only 10 objects, and load the other (hidden) objects after showing the first 10.
This way the user would see the result faster. Only at the moment he/she selects an option, the other objects can be shown fast.
Which would be the best way to accomplish this?
Re: Speed for dialog
Posted: Thu Jun 23, 2011 2:32 am
by Tom
DC_MergeGetLists()?
Re: Speed for dialog
Posted: Thu Jun 23, 2011 5:23 pm
by rdonnay
DC_MergeGetLists() was originally designed to work with Tabpages, but it will work with any set of parents.
Look at \exp19\samples\layertab\layertab.prg and Sample 133 in Sample Group 5 of Xdemo.exe.
Re: Speed for dialog
Posted: Thu Jun 23, 2011 11:23 pm
by skiman
Hi,
I'm using it with tabpages, never tried it in another way. I will try it.
Maybe I can split my dialog in two tabs. Could also be an idea.
Re: Speed for dialog
Posted: Fri Jun 24, 2011 9:10 am
by skiman
Hi,
After implementing the mergegetlists I didn't notice some speed difference.
I started with testing, and I came to the conclusion that building the getlist is FAST. To build the complete getlist of my dialog it takes about 0.25 seconds. Changing the code maybe gives a speed difference of 0.02 seconds. This isn't worth the trouble.
I was looking what took the most of the startup time, and it was opening of the DBF files on the network. This took about 1 second. I checked my code, and there were a lot of files opened at a moment I didn't need them. So I changed my code the following way:
- Open only the file needed to create the dialog.
- Open the other files needed after a click on a button in the EVAL() of the dcread.
The result is that in my case the dialog is shown faster, and half a second later all my files are open as needed. No need to change the way the dialog is build. Rogers code is really fast.
Re: Speed for dialog
Posted: Fri Jun 24, 2011 10:07 am
by rdonnay
Rogers code is really fast
Thanks for that. I know that building the Getlist is really fast. Any slowness would be in creating all the objects from the GetList, but today's computers seem to handle that well. I haven't noticed any unacceptable performance in even my largest applications.