Glossary · Term

control-flow graph

← all terms

Definition

Plain language

A map of all the paths a program can take as it runs — every branch and every loop laid out.

As stated in the literature

A directed graph whose nodes are basic blocks and whose edges are possible transfers of control; in Agent JIT and optimize-anything, the cost model walks it to total up per-step costs and to detect expensive operations nested inside loops.

Also called: control flow graph, control-flow graphs

Why it matters: It lets a tool spot where a program's real expense lies, such as an expensive step hidden inside a loop, rather than guessing from the code's appearance.

For example, it shows that a piece of code runs once at the top but a costly operation buried inside a loop runs a thousand times.

Heard on the show

“The planner walks the control-flow graph of each candidate plan, totals up the costs, and ranks them.”
Episode 063 — Why Web Agents Are Slow: A Compiler-Style Fix for Computer-Use Latency

Mentioned in 1 episode

  1. 063
    Why Web Agents Are Slow: A Compiler-Style Fix for Computer-Use Latency

Related terms