art with code


X application startup times

To find out the fastest way to create a window, I tested a couple different ways with small applications that create a window and exit. Here's a list of the results from fastest to slowest:
  1. Plain Xlib in C: 13 ms

  2. GTK in Haskell: 40 ms

  3. GTK in C: 40 ms

  4. GTK in OCaml: 60 ms

  5. GLUT in OCaml: 220 ms

  6. GtkGL in OCaml: 350 ms

I didn't time Mono and Gtk# this time, but extrapolating from the timings I did before, it'd take around 250 ms (200 ms Mono startup, 30 ms Gtk.Init, 16 ms frame delay to expose event.)

For a baseline comparison, process creation by forking takes 0.7 ms. And as these are graphical applications, they can only display on the next frame at the earliest, which happens after around 16 ms at 60 fps. So if an application starts in less than 16 ms, it's doing as well as can be realistically expected.
Post a Comment

Blog Archive

About Me

My Photo

Built art installations, web sites, graphics libraries, web browsers, mobile apps, desktop apps, media player themes, many nutty prototypes, much bad code, much bad art.

Have freelanced for Verizon, Google, Mozilla, Warner Bros, Sony Pictures, Yahoo!, Microsoft, Valve Software, TDK Electronics.

Ex-Chrome Developer Relations.