Desktop application start up indicators

Havoc Pennington hp at redhat.com
Fri May 28 22:02:26 UTC 2004


On Fri, 2004-05-28 at 16:39, Will Cohen wrote:
> start profiling
> note time
> command-line invocation of application
> 	<bunch of application initialization>
> 	<call library function that indicates application is running>
> 		<key function notes time, shutdown profiling>

You could just profile this program:

int main (int argc, char **argv)
{
  gtk_init (&argc, &argv);
  exit (0);
}

The equivalent for GNOME is a bit more complex (and probably wastes a
fair bit more time).

It's probably a better measure if you create a window, rather than just
the init, since some things are done lazily:

int main (int argc, char **argv)
{
  GtkWidget *window;
  GtkWidget *button;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  button = gtk_button_new_with_label ("Hello");
  gtk_container_add (GTK_CONTAINER (window), button);
  gtk_widget_show (button);
  gtk_widget_show_now (window); /* blocks in mainloop until window
                                   has been mapped by X server */

  exit (0);
}

That should be a good measure of how long it takes GTK + X server to get
a minimal window on the screen.

One thing we know takes time is loading stock icons, so you could make
the button have an icon to add profiling of that issue:
 gtk_button_new_from_stock (GTK_STOCK_OPEN);

Havoc






More information about the Fedora-desktop-list mailing list