>Hi All,
>
>I'm attempting to find bottlenecks in a form that's terminally slow to load.
>
>Here're the things that I know are wrong:
>
>1. Too many controls on the form.
>2. Many tables and views being opened in the DE.
>3. I suspect things like refresh is being called many times.
>
>In the long term, I know the form needs redesigning either with less controls or less tables & views or by instantiating things later.
>
>What I want to do immediately is inspect what's being opened in the DE. Has anyone got any ideas about tactics to investigate what's happening in the DE?
Just a brief check: do all of your views have .NoDataOnLoad=.t.? Just one view pulling from a bigger table, specially if it has a join, could create a substantial drag.
Another thing I noticed with some frameworks is a long .init for controls based on a connection with the data dictionary - each one seems to require several lookups (to the same record). Some frameworks have a builder which allows for moving some (or all) of these things into properties of the controls, which then lose most of the connection with the data dictionary, but then that can be rebuilt.
Yet another thing are the unnecessary refreshes which may happen even before the form shows - I've seen dozens of those, and they have also added substantial time to the instantiation of the form (not in the strictest of the meanings - form is instantiated, it's the activate where this happens). Some of these refreshes may have been necessary in VFP3, but there's no need for it now.