How to profile/measure the pre-main launch time of a win32 application?

Vivek Kumar 1 Reputation point
2022-02-07T12:14:35.267+00:00

I am working on reducing the launch time of our (win32) application. Are there any tools that can be used to measure the following?

  1. Total pre-main time, i.e. time elapsed between double-clicking the app icon and the start of execution of the main function.
  2. Time taken to load each DLL.
  3. Time taken to run static initializers (C++).
  4. Anything else that can degrade launch time.
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
727 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,426 questions
Sysinternals
Sysinternals
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,092 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 9,181 Reputation points Microsoft Vendor
    2022-02-08T03:07:45.627+00:00

    Hi,

    Welcome to Microsoft Q&A!

    As far as I'm concerned, you could try to use Performance Counters. Windows Performance Counters provide a high-level abstraction layer that provides a consistent interface for collecting various kinds of system data such as CPU, memory, and disk usage.

    And you could refer to the thread: https://stackoverflow.com/questions/375913/how-can-i-profile-c-code-running-on-linux. There are many diagnostic tools you could choose any one to analyze your application.

    You need to profile the application, and then find where you could reduce the launch time of the application. You could refer to the thread: https://stackoverflow.com/questions/2183505/ways-to-improve-the-launch-speed-of-c-application

    Best Regards,

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments