thanm / pcritical

critical path analysis tool for go programs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pcritical

A prototype critical-path finding tool for Go programs.

Given a specific directory in a Go module, this tool enumerates the dependencies of the target and tries to project what will be the critical path for the build. Build time is not measured directly, but rather compiled package size is used a a proxy for build time.

For example, consider the following Go package dependency graph:

                 +---+
                 | P |
                 +---+
                 /   \ 
                v     v
              +---+   +---+
              | Q |   | R |
              +---+   +---+
                |   \   |
                v    v  v
              +---+   +---+
              | S |   | T |
              +---+   +---+

Suppose that package build sizes/times are: { P=10, Q=11, R=11, T=29, S=3 }. In this case the critical path for building P is { T => R => P }.

On the other hand if instead { S = 99 }, then the critical path for P is { S => Q => P }.

Running pcritical

To run the tool, supply a target package and the name of a DOT file to generate. Here is an example of running pcritical on itself:

./pcritical -dotout me.dot -tgt github.com/thanm/pcritical 

which produces this graph:

dot diagram for pcritical

May take a while to run, since it builds packages to see how large they are.

Flags

The -nostd flag tells pcritical to ignore packages that are part of the Go standard library.

The -polyline flag tells pcritical to emit DOT output with polyline edges as opposed to splines.

About

critical path analysis tool for go programs

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%