Re: Measuring startup time



On Mon, 2005-12-19 at 16:59 +0000, Milen Dzhumerov wrote:

> I wanted to ask what's the appropriate way to measure the startup time
> of an application? Should I use clock() and comment out gtkmain()
> assuming that it doesn't have a high overhead and only starts the
> mainloop? Or some other technique?

You can probably assume that your app is done setting itself up when its
main window gets painted on the screen.

You can g_signal_connect_after() to the "expose-event" signal on your
main window.  In the signal handler, exit() the program.  You can then
run /usr/bin/time to know how long it took.  Do a lot of runs and
average the numbers.

Getting reproducible numbers for an app's startup time is pretty hard,
though.  We need something in the kernel that will let you invalidate
parts of the buffer cache.

  Federico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]