>>>I have a VFP9 app that runs against Sql Server. When I runs the forms from the FoxPro IDE, running against the same Sql Server database which is located on a central server down the hall (i.e. NOT on my local developer machine), all the forms load up and run very quickly.
>>>
>>>However, once compiled into an exe, and runnging the compiled exe from by same devloper box (outside of the FoxPro IDE), the forms take about twice as long to load up. This is very consistent across all forms.
>>>
>>>Is there particular reason that forms would run more quickly inside the FoxPro IDE than when compiled into an EXE?
>>
>>I FIGURED IT OUT!!!
>>
>>Remedy here:
http://mattslay.com/foxpro-newobject-fast-here-slow-there/>
>Just a swag... are you using SYS(2450,1) to indicate that resources should be searched within the executable first?
>
>Walter,
Okay, I went back to the NewObject() way, and added your SYS(2450,1) suggested, and did careful, repetitive testing to be sure I cold report the correct results...
Result: Using Sys(2450,1) along with NewObject() does help a little bit when running inside an exe, *BUT*, it is still slower than using SET PROCEDURE along with CreateObject().
There are very distinctive and noticeable speed differences:
1st place: SET PROCEDURE + CreateObject() = 1.4 seconds
2nd place: Sys(2450,1) + NewObject() = 5 Seconds
3rd Place: NewObject() alone (leaving Sys(2450) at the default value of 0): 7.2 seconds
.