All | 43 Folders | Accessibility | BoingBoing | Books | Computer Related | Family | Films | General | Hacking | Hobbies | Humor | Java | Links | Omni | OpenSolaris | Puzzles and Games

« Previous day (Feb 12, 2007) | Main | Next day (Feb 14, 2007) »
20070213 Tuesday February 13, 2007

Orca Python Call Graph

Yesterday I saw a link on popurls.com to pycallgraph, a Python library that will generate call graphs and thought that I'd give it a try with Orca

I had to wait until today to download it, as being popular knocked out their server. I also had to install Graphviz, a prerequisite. That was easy. Just a few clicks away via the Synaptic Package manager on my Ubuntu system.

Integrating the pycallgraph code into Orca was trivial. Two lines near the start of the application:

import pycallgraph
pycallgraph.start_trace()

and then two lines just before it terminates:

pycallgraph.stop_trace()
pycallgraph.make_graph('orca-call-graph.png')

Creating the call graph counts is very CPU and memory intensive, so I then had to make a couple other adjustments to the Orca code, to convince it that it hadn't commited suicide:

If anybody else is interested, here's the full set of diffs I had to make to Orca.

As Orca was pretty much unusable whilst these statistics were being instrumented, I just started up Orca and once it had fully started, I then just terminated it.

That generated a 16188 x 4187 PNG Orca call graph image, which is quite awkward to view.

Although it's interesting and quite clever (and probably very helpful with small, simple Python applications), I think in order to be useful with Orca, the call graph data needs to be in a different format. Maybe just plain old ASCII table entry. Bonus points if it can do a function tree hierarchical view usage in ASCII too. I also wonder whether this is something that an appropriate set of DTrace probes would solve, so much more simply.

Any good simple alternative Python call graph packages out there?

[]

[]

[]

( Feb 13 2007, 11:12:41 AM PST ) [Listen] Permalink Comments [3]

Pinewood Derby Racing

Every year, Duncan's school's Boy Scout troop have a Pinewood Derby racing afternoon at the school's multi-purpose room. This is the third year that Duncan has entered a car. This year he wanted to win so badly that he actually asked for my help.

This was all new to me. Last year I blogged about it but Duncan didn't want my help that year; he wanted to do it all himself, so I didn't take it any further. This year, I followed some of the links from that post and put together some ideas on what we should do:

So we came up with the design above (the orange/brown car). It lost some of its streamline-ness after I'd put the weights on, so as to get the center of gravity where it needed to be. Even though Duncan should have been doing as much of this work himself, he wasn't up to doing the cutting. He did help with the sealing, sanding and painting. I screwed the weights on.

On Sunday afternoon, we turned up early and weighed in. We were 0.2 ounces less than maximum, but Duncan didn't want me to add any more weights. We were given the option of dusting the axles with graphite dust to help reduce friction. We did this, but I think it wasn't enough. More on this below.

The races began. In the two heats that Duncan's car was in, it came last each time. Duncan was very upset. As any good parent knows, you don't like to disappoint your kids, so I started watching all the rest of the races intently to see if I could see where we went wrong and to see if I could come up with some ideas to help build a winning car for next year.

Here are my (unconfirmed) findings:

The other thing we are going to do is get a couple kits earlier than we did this year and try experimenting with different things.

It's a pity that there isn't a publically available test track that we can practice on before the next race.

[]

[]

[]

( Feb 13 2007, 07:48:54 AM PST ) [Listen] Permalink Comments [14]