Calling all graph nerds! I've generated a graph of elf sections in #CircuitPython firmware. How would I find the edges I could cut to remove code from my binary? (Think -fgc-sections)

@tannewt I'm not sure I understand the criteria... You just pick any node you want to remove, and cut all the edges coming from it?

@deshipu Correct, find the "rogue" references that pull in a lot of code. CP modules will probably be highlighted too

@deshipu For every node with one incoming edge, find all successors that are only reachable from the first node. Each node has a size that we can sum for total byte size.


@tannewt I'm not sure it helps, but I think that finding minimal cuts (assuming all edges have the same weight) would at least give you the suspects to consider.

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!