Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 673337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:35:06+00:00 2026-05-14T00:35:06+00:00

For performance tests I need a way to measure the time needed for a

  • 0

For performance tests I need a way to measure the time needed for a form to load its definition from the DFM. All existing forms inherit a custom form class.

To capture the current time, this base class needs overriden methods as “extension points”:

  1. start of the deserialization process
  2. after the deserialization (can be implemented by overriding the Loaded procedure)
  3. the moment just before the execution of the OnFormCreate event

So the log for TMyForm.Create(nil) could look like:

- 00.000 instance created
- 00.010 before deserialization
- 01.823 after deserialization
- 02.340 before OnFormCreate

Which TObject (or TComponent) methods are best suited? Maybe there are other extension points in the form creation process, please feel free to make suggestions.

Background: for some of our app forms which have a very basic structure (with some PageControls and QuantumGrids) I realized that it is not database access and other stuff in OnFormShow but the construction which took most of the time (around 2 seconds) which makes me wonder where this time is spent. As a reference object I will also build a mock form which has a similar structure but no code or datamodule connections and measure its creation time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:35:06+00:00Added an answer on May 14, 2026 at 12:35 am

    The best place for “instance created” is TObject.NewInstance.

    In Delphi 2009 the best place for “before deserialization” is TCustomForm.InitializeNewForm. If that isn’t available override TCustomForm.CreateNew and grab the time immediately before it returns.

    You’re correct that the best place for “after deserialization” is TComponent.Loaded.

    For “before OnFormCreate” override TObject.AfterConstructor and get the time immediately before calling the inherited method. If you want the total construction time, grab the final time after that inherited call returns. That will include both the OnFormCreate and any initial activation time. Alternatively, you could just override TForm.DoCreate, if you’re not overriding that anywhere else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there way to optionally compile dependency from source (svn) instead of using the
I need to read (scan) a file sequentially and process its content. File size
I'm writing an app in modular way, so I can possibly reuse some of
Edited: Please note, when I mention performance comparison, it is not performance comparison of
If I need to see if a certain value is in a string, is
I've been trying to evaluate load and perfomance test tools and i think i
Tonight I've been taking a look at some code I've been working on over
We're doing some prototyping of a new app and noticed that one of the
I was told that, I misunderstand effects of final . What are the effects
Back-Story On a current project, I am using MySQL and SQLite in combination with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.