Build profiling

Measure generation time and identify slow steps before they become delivery blockers.

Run with profiling

Profiling adds timing output for major build phases so you can see whether slowdowns come from config generation, scanning, or purge work.

npx emily-css build --profile

How to read the output

  • Watch for sudden increases in scan time after source glob changes.
  • Watch full framework generation after token family expansions.
  • Watch purge time when utility count or template count spikes.
  • Track total build time in CI to catch regressions early.

Typical causes of slow builds

  • Overly broad source globs scanning non-template files.
  • Large generated output diffed repeatedly during dev startup.
  • Excessive one-off utility families from config bloat.
  • Multiple build triggers in local scripts and watchers.

Fast fixes

  • Narrow source globs to the templates you actually render.
  • Use dev sync checks to skip full build when outputs are fresh.
  • Keep token additions intentional and documented.
  • Separate local preview checks from CI release builds.

Next step

Use Doctor after profiling to clean invalid classes and reduce wasted scan work.