Random notes from mg

a blog by Marius Gedminas

Marius is a Python hacker. He works for Programmers of Vilnius, a small Python/Zope 3 startup. He has a personal home page at http://gedmin.as. His email is marius@gedmin.as. He does not like spam, but is not afraid of it.

Fri, 28 Sep 2007

Simplifying dependency graphs with graphviz

Remember the package dependency graph of z3c.formdemo produced by tl.eggdeps?

z3c.formdemo dependency graph (small version)
the insane graph, scaled down from 14153x2729 to 480x93

If you filter the dot file through tred from the graphviz suite of tools, it will remove redundant dependencies (that are already implied by transitivity) and produce something actually useful:

z3c.formdemo dependency graph filtered by tred (small version)
the useful graph, scaled down from 2695 x 2394 to 480x426
posted at 18:21 | tags: | permanent link to this entry | 0 comments

Wed, 26 Sep 2007

Foliage sprint day 2

Stephan Richter convinced me to try the ZCML optimization task. Zope 3 parses and interprets hundreds of little ZCML configuration files on startup. The idea was that if we can cache pre-parsed configuration on disk, we could speed up Zope 3 startup by 30–50%.

I originally tried this approach back in 2004 but couldn't get it to work. Today, thanks to Stephan Richter, who took over the most boring and difficult parts (making view directives pickleable), we got to a point where Zope 3 works after loading the configuration pickle instead of parsing ZCMLs (and starts up in 2 seconds instead of 3).

The code is still at a prototype/proof-of-concept level, full of ugly hacks. The tests are also not very happy (68 failures, 115 errors out of 6955 tests). The patch describes the changes in greater detail.

We also had a nice dinner in a Japanese all-you-can-eat buffet called Minado.

posted at 06:46 | tags: | permanent link to this entry | 0 comments

Tue, 25 Sep 2007

Foliage sprint day 1

One of the reasons I wanted to come to the Foliage sprint was to get acquainted with the brave new world of Zope 3 eggs. For this reason I chose to work on package dependency simplification.

I spent a couple of hours reading setuptools documentation, easy_install and zc.buildout source code, trying to figure out the right way to extract dependency information from a set of eggs. Then philiKON mentioned tl.eggdeps to me. Yay!

Running it on z3c.formdemo produced a huge and unreadable graph. The original was 14153x2729 pixels, here's how it looks when zoomed out:

z3c.formdemo dependency graph (small version)

The text version of the dependency tree was better, but not too convenient either. I got the idea of an interactive dependency tree viewer so that I could expand only those parts I'm interested in and ignore the others. That's what I worked on for the rest of the day:

Gtk+ egg dependency viewer

You can easy_install gtkeggdeps and inspect the dependencies of all your installed packages.

posted at 05:24 | tags: | permanent link to this entry | 0 comments

Mon, 24 Sep 2007

Foliage Sprint

I'm at the Zope 3 Foliage Sprint. The main point of this post is to fix the fact that the canonical sprint wiki page is not even on the first page of Google results.

Update: apparently that's caused by

<meta name="robots" content="noindex" />

in the HTML.

posted at 16:12 | tags: | permanent link to this entry | 0 comments