Skip to content

refactor: Parse BUILD-files once#23394

Open
tobni wants to merge 1 commit into
pantsbuild:mainfrom
tobni:perf/parse-build-files-once
Open

refactor: Parse BUILD-files once#23394
tobni wants to merge 1 commit into
pantsbuild:mainfrom
tobni:perf/parse-build-files-once

Conversation

@tobni
Copy link
Copy Markdown
Contributor

@tobni tobni commented May 31, 2026

Was a theoretical cold-start performance gain that turned out to be minor. I do think this is cleaner though.

@tobni tobni added category:internal CI, fixes for not-yet-released features, etc. category:performance release-notes:not-required [CI] PR doesn't require mention in release notes labels May 31, 2026
@cburroughs
Copy link
Copy Markdown
Contributor

Thanks for looking at this and the multi-parse has bothered me every time I looked at it.

I'm struggling to find my prior notes, but when I tried this it was counterintuitively slower on whatever I tried it with, presumably because ast.parse(str)+ast.compile(tree) doesn't just to hang out in C like ast.compile(str). Was it noise or faster with what you were looking at?

@tobni
Copy link
Copy Markdown
Contributor Author

tobni commented Jun 1, 2026

This change is within noise wallclock but does reduce total cpu, mostly due to reduced allocations. It scales with number of build files and symbols therein.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:internal CI, fixes for not-yet-released features, etc. category:performance release-notes:not-required [CI] PR doesn't require mention in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants