troubleshooting Question

Big differences in speed with which a FORM loads

Avatar of IainMacb
IainMacbFlag for United Kingdom of Great Britain and Northern Ireland asked on
5 Comments2 Solutions556 ViewsLast Modified:
I've got a FORM in an application which seems to load very slowly by comparison with the other FORMs in the same application.

This is giving me some serious grief because the application also features an anti-piracy software key that's attached to the PC. The application talks to the software key at regular intervals. If the link with the software key drops, then the application crashes. And what seems to be happening here is that loading the FORM is taking so long that the link does indeed drop.

I've looked at what's going on inside the FORM in great detail and can't see anything obvious that would slow it down (particularly during the .INIT() methods). The FORM contains a pageframe, and buttons for [OK] and [Cancel]. The pageframe has four separate tabs. The .SCX file contains 30 records, which seem to correspond to 28 distinct objects.

I've tried embedding some timing points within the FORM. I've tried timing from starting the .LOAD() method to ending the .INIT() method. Running under VFP, that comes out at 0.02 seconds on my laptop (a rather fast Dell XPS machine).

Where's the problem, I hear you cry. Ah well, once I've compiled the application as a .EXE, it slows down. And on my laptop it takes 15.2 seconds. Which is a pretty stupendous slow-down factor.

The target machine, where we want to run the compiled code, isn't as quick as mine, so we could well be talking 30s+, which is getting into the range where the software key will time-out and terminate the application.

Next I tried putting in more intermediate timings. With these in place, it still took 15.2s. But it pointed towards one of the pages being the guilty party, taking all of the time.

There's four objects on that page. None involve any processing as part of their .INIT() method. Anyway, I put in even more intermediate timings for the objects on that particular page.

But now the elapsed time from .LOAD() to .INIT() is a mere 0.19s. The page that I had my suspicions about takes 0.13s of this. And the gap between finishing .INIT() for the last of the four objects and finishing the .INIT() for the page is all of that - the .INIT()s for the objects are all reporting as the same time.

Now, what my question is about is why I should be getting this big variation in the time taken to load the FORM - down from 15.2s to 0.19s. Does anyone have any similar experiences?
Olaf Doschke
Software Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros