Re: Desktop application start up indicators

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



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




[Index of Archives]     [Fedora Users]     [Fedora KDE]     [Fedora Announce]     [Fedora Docs]     [Fedora Config]     [PAM]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux