How to increase the startup speed of the delphi app?

前端 未结 11 1953
醉梦人生
醉梦人生 2020-12-24 09:54

What do you do to increase startup speed (or to decrease startup time) of your Delphi app?

Other than application specific, is there a standard trick that always wor

相关标签:
11条回答
  • 2020-12-24 10:47

    Fastest code - it's the code, that never runs. Quite obvious, really ;)

    0 讨论(0)
  • 2020-12-24 10:53

    Well, as Argalatyr suggested I change my comment to a separate answer:

    As an extension to the "don't auto create forms" answer (which will be quite effective by itself) I suggest to delay opening connections to databases, internet, COM servers and any peripheral device until you need it first.

    0 讨论(0)
  • 2020-12-24 10:57

    Deployment of the application can (and usually does!) happen in ways the developer may not have considered. In my experience this generates more performance issues than anyone would want.

    A common bottleneck is file access - a configuration file, ini file that is required to launch the application can perform well on a developer machine, but perform abysmally in different deployment situations. Similarly, application logging can impede performance - whether for file access reasons or log file growth.

    What I see so often are rich-client applications deployed in a Citrix environment, or on a shared network drive, where the infrastructure team decides that user temporary files or personal files be stored in a location that the application finds issues with, and this leads to performance or stability issues.

    Another issue I often see affecting application performance is the method used to import and export data to files. Commonly in Delphi business applications I see export functions that work off DataSets - iterating and writing to file. Consider the method used to write to file, consider memory available, consider that the 'folder' being written to/read from may be local to the machine, or it may be on a remote server.

    A developer may argue that these are installation issues, outside the scope of their concern. I usually see many cycles of developer analysis on this sort of issue before it is identified as an 'infrastructure issue'.

    0 讨论(0)
  • 2020-12-24 10:57

    This is just for the IDE, but Chris Hesick made a blog posting about increasing startup performance under the debugger.

    0 讨论(0)
  • 2020-12-24 10:58
    • First thing to do is to clear auto created forms list (look for Project Options). Create forms on the fly when needed, especially if the application uses database connection (datamodule) or forms that include heavy use of controls.
    • Consider using form inheritance also to decrease exe size (resource usage is mimized)
    • Decrease number of forms and merge similar or related functionality into single form
    0 讨论(0)
提交回复
热议问题