Flame graphing the leftness of infra tooling
Last month I claimed chant sits to the left of other infra toolchains when it comes to execution.
To prove this claim, I wrote the same small app for both CDK and chant. Next, I verified both produce the same resources, and ran each tool with Node’s profiler recording.
A recording reads from left to right, with time on the X axis. Every block is code that ran, and highlighted blocks are caused by your app, meaning your files, plus the infrastructure library they pull in.
Here are both runs, same recorder, same lighting rule:
The top strip is CDK. The yellow line near the left edge is your program starting, and from there the strip stays lit to the end. Everything CDK knows about your infrastructure, it learned by running your code and watching what it constructs. Zoom in and you can read it happening:
Table2 is your database table. Role2 is your IAM role. Function2 is your Lambda. Each one came into existence because a constructor executed inside cdk synth.
This is CDK’s design. There is no way to know what a CDK app builds without running it, which means whatever your code does happens before the tool knows what it’s looking at.
The bottom strip is chant, and it’s just as busy, but nothing lights up. That’s not a lucky sample from a profiler that happened to look away: the build refuses to finish unless it can account for every file without running it.
Don’t take the pictures’ word for it. Both recordings are live in spicypath, my profile viewer — no install, no login:
- The CDK recording, with a marker on the moment your code starts.
- The chant recording, where the same search for your code comes back 0 matches — the whole strip dims because nothing qualifies.
One caveat, this works for code written in chant’s supported style. Files that are deliberately programs still run, in a sandbox, with intention. What sits left of the execution line is exactly the part of your repo that describes infrastructure rather than computes it.
Everything regenerates from committed inputs and the procedure lives in the harness. No timing numbers anywhere in it, on purpose. This is not a benchmark.
Read more
- The far-left IaC tool — the claim this post records
- TypeScript as data — the supported style that makes reading-without-running possible
- spicypath — the viewer, which also eats your pprof, JFR, and heap dumps