|
-
Mar 12th, 2007, 03:05 PM
#1
Thread Starter
Member
Slow forms and some os info.
I'm having some performance issues with my Pocket pc 2003 application , I'm using multiple forms and have read that using panels would increase my performance , but i don't see that working with the amount of programming that needs to be done and the amount of things that need to be loaded when a form is being loaded...,
Strider mentioned a class of ("preloading" forms) can someone give a short example on how to do that ?
Ive preloaded some forms , with form1.show,form1.hide , and it does increase loading time but , this is obviously not what strider meant.
Second thing I'd like to know , will my Pocket pc 2003 application run on Windows mobile 5 phone edition ? with the ability to install the compact framework 2.0 and sql server 2005 ce ?
...Specifically on this device .. hp-ipaq-hw6915 , i cant get my head around what's the difference between a windows ce 5.0 application and the different OS's for Pda's..
Do i need the OS pocket pc 2003 for this application or will windows mobile 5.0 have what it takes.?
Thx.
-
Mar 13th, 2007, 08:33 PM
#2
Re: Slow forms and some os info.
I would expect that to run a 2003 program on a CE 5 platform would be possible, but you would just have to install the 1.1 CF. Haven't tested it, so I wouldn't swear to it, but it makes sense.
I think I am the most vocal advocate of panels, and it really would be the solution to your problems, as it would increase the early loading speed, and move the form switching time into the instantaneous realm. However, if you really don't want to go there, you may have to play around with a few things to figure out how to load several forms. It kind of looks like you might be able to raise the Load event in the constructor, but I don't know if that would advance the situation all that much.
I also realize that at this time I am not set up to test whether it is actually creating the instance, or showing the form which is slow. For me, most of my load time is involved with connecting to a database. Showing a form is relatively fast, while the DB stuff is slow. Since I only load one form, I never get to see whether instantiating, or showing the form is where the time is taken. You might test that out, by creating a new instance, then showing it. Then put a breakpoint on the show line and time how long it takes to reach the break, then move the breakpoint to the line after the show, and time how long that takes.
My usual boring signature: Nothing
 
-
Mar 14th, 2007, 03:04 AM
#3
Thread Starter
Member
Re: Slow forms and some os info.
Do you know a way of transporting loads of buttons and code behind them into a single form without losing the code ? (if i wanted to start using panels and start grouping all of them ?)
Im using alot of database connections too.which could also slow down the system.
Microsoft forums also suggest , using .bounds in the initialize component to speed up loading forms.Cant say if that helps alot but ill know that when my program is finished.
thx anyway ,
Last edited by IamMacro; Mar 14th, 2007 at 03:58 AM.
-
Mar 16th, 2007, 05:30 PM
#4
Re: Slow forms and some os info.
"Alot" of database connections? I've never used more than one, and even that was PAINFULLY slow. I measured a start time of 6s for one simple program, and the bulk of that was the connection. To get around that startup lag, I loaded a splash screen which had a fake image of the program. That will not work if the user needs to interact with the screen, but that wasn't necessary in this case. Loading the splash screen prior to establishing the DB connection took 2s, while the time until the whole program was up and running was increased to only 7s (Thus the user saw the splash screen four seconds quicker, while they were able to interact with the program one second later than before).
On a desktop, you might only establish a DB connection when you need to. Good practice in many cases. On a PDA, because of the cost of the connection, and the fact that there will never be multiple concurrent users of the DB, I would say that you should open one connection, and maintain it for the life of the program.
Transporting loads of buttons and the code behind them: Nope, I know of no good way. Copy and paste will get you close, but not all the way there. If you have name conflicts between the different controls, that will be a problem, as will copying the event handlers, potentially.
I've never tried .bounds.
My usual boring signature: Nothing
 
-
Mar 18th, 2007, 12:12 PM
#5
Thread Starter
Member
Re: Slow forms and some os info.
Well im using alot of Select statements , to retrieve data from 1 mobile database.. , if i would keep the connection open , i wouldnt be able to retrieve multiple sql Statement's cause it will say "This connection is already open"
For example.
"one combobox retrieves all the customers when someone selects something from the combobox , it will retrieve all the customer data in that combobox and so on.."
What is still odd , that even a form screen with like 40 lines of code and without any connections and only 4 buttons , loads slowly.
Or maybe the 2nd form is loading components from the 3rd form which is alot "heavier coded".
Im wondering if the problem will be fixed when i actually use a PDA instead of the emulator..
the .size and .location in the initialize component can be replaced with .bounds , for a faster load up , but i havent been able to test it.
i hope its understandable cause im quite tired =)
-
Mar 18th, 2007, 05:24 PM
#6
Re: Slow forms and some os info.
I doubt you'll see any improved speed on the actual device. While you won't be "emulating" any more, you will also be running on a MUCH slower processor. I stopped using the emulator years ago, though, so I don't know for sure.
I guess I haven't tried the DB things you are doing, either. I mostly use DataReaders, but you may not be able to. I would fill the combobox from one datareader (then get rid of the datareader, as it wouldn't be of any use anymore), then when somebody selected something from the combobox, I'd get another datareader to get the requested info. If you had to leave one of the DataReaders open for some reason, then this wouldn't work, because you can't have two open datareaders on a single connection, as you already know. However, I have yet to encounter a situation where this has been a problem.
My usual boring signature: Nothing
 
-
Mar 18th, 2007, 05:28 PM
#7
Thread Starter
Member
Re: Slow forms and some os info.
Mzzzz , well datareaders tend to be alot slower if i believe this article ,
http://www.devbuzz.com/content/zinc_...mbobox_pg2.asp
It uses classes to fill up comboboxes instead of datareaders and im using this technique to do so.
-
Mar 19th, 2007, 11:21 AM
#8
Re: Slow forms and some os info.
Did you notice that in that article they are using DataReaders to fill the classes? Let's hope they don't slow him down too much
DataReaders, being a forward only, read only, recordset, are about as fast as you get. There are some advantages to the technique he is showing, though, because all of the relevant data is being held in the class, such that a further DB read is not necessary so long as any needed data is part of the set held in the class.
In my programs, the data in the combobox (or in the class, in the case of that example), would be used to form the SQL statement to get the DataReader for the second query. Certainly not the only way to do things, though.
My usual boring signature: Nothing
 
-
Mar 19th, 2007, 11:39 AM
#9
Thread Starter
Member
Re: Slow forms and some os info.
ok ok datareaders are being used , and so am I =] , programming all day can make you talk crazy
Last edited by IamMacro; Mar 19th, 2007 at 11:48 AM.
-
Mar 19th, 2007, 05:55 PM
#10
Fanatic Member
Re: Slow forms and some os info.
sorry for the late reply... to busy of late to keep up with the forums...
i have a sample of here of using a controller class to display forms in a CF application. http://www.vbforums.com/showthread.p...light=mainCtrl
the reason i use it is to load commonly used forms in the application, load any configuration files, establish the connection to the database while the splash screen is been showed.
This enables forms with lots of panels/controls to show faster.
Generally any databases on the device will only ever be used by the one application and one instance of the application can ever be running, i therefore create the connection and open it on the application loading and close it when exiting the application. This speeds up querying in the application.
Another rule is when loading data into a control is to hide the control when loading the data as the control refreshes everytime an item is added and therefore slows it down. Also maybe us a Panel (pnlBusy) to display some text/images that its loading data if it takes several seconds...
I hope this helps... and if u have any other questions let me know.. and hopefully i can get back to u soon!!!
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 20th, 2007, 09:44 AM
#11
Thread Starter
Member
Re: Slow forms and some os info.
Another rule is when loading data into a control is to hide the control when loading the data as the control refreshes everytime an item is added and therefore slows it down. Also maybe us a Panel (pnlBusy) to display some text/images that its loading data if it takes several seconds...
hiding the controls have speed up my comboboxes significantly , great find.
Using the class control for my forms is something else..im using vs2005 and like the other people in that thread its hard to actually do that.
Its pushing me in the right direction i guess , but after searching the internet for a while , i cant seem to find a splash screen for vs2005 in .net + pre-loading forms + compact framework, everything is c#,
Ive been messing around in the initializecomponent trying to
actually Load the forms in my memory before even accessing them.
"Dim frm as actualForm" or "dim frm as new actualform"
If i .show and .hide them the form pops up , and closes and get called back faster which is what i want but it doesnt look pretty without a splash screen (which i tried to make of course) ,
But some forums suggested putting opacity on 0% but dont think compact framework supports that.
Thx for your tips though
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|