Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make my application Load Faster!!!! 7

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
US
In My office, we have a Lan.

Server: P4 1.6 MHZ, 512DDR Ram, (IDE HDD), 10/100 FastHub
OS on Server: Win2k Server
Data Drive: NTFS

Application:
Built with VFP 7.0
EXE Size: 1.06 MB.
Databases: 1
Tables: 30 (They are empty, no data in the tables YET!!!)
Free Tables: 1


When I run the application from any station it takes about 5 seconds to load. But, when someone else is already running the application. It takes 10+ seconds to load....
So, some users think, the program is not starting, and they try to double click again... It is so aggrevating!!!

So, I put the exe on each station, and I pointed the Start IN, in the Data Drive of the server. and it still takes long time to load, when more than 1 user is using the app..


So, what I did:

I re-compiled the app, without even loading a single table or opening the database.
***********
Set exclusive off
set multilocks on
set century on
set deleted on
set ... (whatever)

set path to "\wt;\wt\data;\wt\reports;\wt\forms"

*OpenData() <--- I don't open any data

do form DashBoard
Read Events

It loaded a little bit faster, but, not too impressing!

And it is still killing me!!!!! when 2 users log on...

What the heck is the problem. On my PC, it loads awesome! (Though, I have a fast pc)...

But, what seems to be the problem...???

Please Help!! Tekno
 
Sometimes a splash screen will help, at least letting the users know it is running.
But, if you put the network directory as the Start In, make sure it isn't still executing the application on the server.


Dave S.
 
Well, Dave, I put a Wait Window 'Initializing Files ...&quot; NOWait

But, That doesn't help. I need to make the App Faster.

Do you think it is the Network. or is it because THE EXE SIZE is HUGE????

I don't know. Please Help!!!!!!!!!!!!!!!!!! *Begging*** Tekno
 
Try ideas listed from these pages for your immediate problem:



I use the &quot;Delayed Instantiation&quot; technique myself. Also, I break my apps into several components, only loading what is needed at the time. Quoting from an n-tier document from Microsoft: &quot;Breaking a large piece of software into smaller pieces can make it easier to build, easier to reuse, and easier to modify.&quot; IMO you'll get better peformance all around by using this approach in the future. It does create more pieces to manage/deploy, but the pros (for me anyway) outweigh the cons.

Good luck!
--Michael

Michael Babcock, MCP
Founder, Central PA Visual Foxpro User Group
mbabcock@cpvfug.org
 
Try adjusting the SET REPROCESS time for user contention issues... It could be trying to lock a login table record and waiting 5 seconds only to find it couldn't lock it, then appending instead, for example.
 
Do you have combos, lists, arrays, ... in your screens that have a control or record source coming from tables, views, queries,...? I know you said you don't open any tables at first, but if any sort of lists are being built at instantiation time, that could slow things down. If you do have any of those scenarios, changing code to open the table at activate or set focus time instead of init time sometimes helps.

Dave S.
 
Is your data on an NT server?

1) Move it to a local drive and test performance.
2) Disable opportunistic file locking on the workstations
and the server, I can e-mail the .reg files if you
want them.

HTH Regards

Griff
Keep [Smile]ing
 
Not really Dave... Nothing in the init. events....

When the software loads. ... then it is fast... but, initially it is not...

Mike, I would like to know how I can brake my app into different pieces..

I used to do that with clipper. Create OVL (Overlay files), and thus reducing the exe files... and Only the OVL will be loaded when needed.

I don't know how I can do so in VFP.. can some one tell me..

Thank you! Tekno
 
Mike, When I run the program on a local machine, it loads super good...

And Yes I do have NT based server. Win2k Sever

What are the .REG files..? Yes, Please email me thouse
teknosds@hotmail.com
Tekno
 
Sorry, I meant the last message to &quot;Griff&quot; Tekno
 
Do you also have the runtime files installed locally on the user's pc's?

Dave S.
 
Yes!!
I used the Installshield to distribute the DLLs in the local machines.. I had to do it, because, it would not run, unless I did so...
Tekno
 
How do you disabled Opportunistic FIle locking? Tekno
 
Uncle.

Sorry, I'm out of immediate suggestions, but open up the MDSN Help file and do a search on:

&quot;Optimizing Forms and Controls&quot;
-or-
&quot;Optimizing Applications&quot;

See if there are any tips there.

Dave S.
 
To use the &quot;Delayed Instantiation&quot; technique (which merely says don't create the containers/controls under you really need them--for example, the controls on pages that are not initially showing don't need to be instantiated until the user navigates to that area), say your screen pieces into containers and then in the Activate of your pages, instantiate the containers holding the necessary objects. Here's some sample code in the page.activate event:

&& mjb 08-20-01 subclassed these controls for componentized development (enabling me to update on the fly without hardwiring)
with this
.fontbold = .t.
if .ControlCount = 0 then && instantiate shared object
.AddObject(&quot;pgfDemoOutcome&quot;,&quot;pgfDemoOutcome&quot;)
with .pgfDemoOutcome
.Left = 20
.Top = 1
.Visible = .t.
endwith
endif && controlcount = 0
.refresh()
endwith

See the links I mentioned for better information (i.e., where I got it!).

HTH,
--Michael
 
This is a common problem on Win2k. Before you try to enhance your code check these things first.

-Do you have a Anti-Virus? If yes, try close it and now try the application.

-Does the server have screensaver off? If no, that can slow down the application enormous.

This took me alot of time to configure. A client of me had the same problem with multiple users. Our application is about 10 Mb with alomst a hundred tables. We figured it was the Norton Antivirus that slowed it down. Shutting it off resolved our problem. Hope this helps.

Greetings.
 
Gandalf23 , yoU ARE SO RIGHT!!!!

I revised my codes, as suggested by others, and it did help alot. Thank you all!

But, the ultimate was the Anit-Virus ..... In norton, I had to &quot;Exclude&quot; my Directory or at least the extensions (*.dbf, *.cdx, *.dbc)....

Thank you all Tekno
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top