Code as artwork
Many people think of code as artwork in some way or another and consider good code something of elegance and beauty. While working today, I came across another example of that in a visual representation of a project I’m working on.
This image shows the call graph of the file I’m editing, which is one component of a much larger project. I made it with Python’s hotshot profiler and José Fonseca’s Gprof2dot. Brighter colors mean more time is spent in those functions or their children, although it’s hard to see at this size. Or does it show some sort of futuristic gun? Your call.
The above callgraph shows every single function, but here’s a profile generated with the same tools that shows only functions that use a certain percentage of time. You can actually see the colors:


This is amazing. Code always has some sort of underlying order and structure. It’s awesome to see it visually represented like this.
Thomas Cleberg
June 30, 2008 at 11:11 pm
At first glance, I thought it was a slightly squished map of the world.
James Le Cuirot
July 1, 2008 at 1:19 am
[...] Donnie Berkholz is outputting profiler results in colour. [...]
Interstellar Medium: the Free Software carnival » Free Software Carnival: 28 June – 4 July
July 4, 2008 at 4:08 pm
[...] Graphe d’appel en couleur: comment rendre (presque) joyeuse une tache de profiling (ousqu’on regarde à quel point ce qu’on a codé est lent à mourir) [...]
tlog » Archives » Programmation artistique
July 14, 2008 at 11:15 am
http://rtprof.sourceforge.net/ is pretty neat too.
Mikachu
July 29, 2008 at 6:50 pm