Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The outer layer of dev docs. #23

Merged
merged 2 commits into from
Dec 18, 2022

Conversation

jsirois
Copy link
Contributor

@jsirois jsirois commented Dec 18, 2022

Additional more detailed docs on the basic structure of scie-pants and
its main process execution flows is coming separately.

Work towards #7

Additional more detailed docs on the basic structure of scie-pants and
its main process execution flows is coming seperately.

Work towards pantsbuild#7
CONTRIBUTING.md Outdated Show resolved Hide resolved

There are just a few guiding principles to keep in mind as alluded to above:
+ The `scie-pants` hot path should be fast: It currently launches Pants in ~one millisecond and that
should hold steady.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have/are there any perf tests that may run automatically/in CI to ensure this will hold true over time?

Copy link
Contributor Author

@jsirois jsirois Dec 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should. I'm not sure exactly how to do it yet. Pants gets in the way since its slow. There are 3 separate binary executions in the hot path:

  1. The scie-jump launches the embedded scie-pants.bin binary as the default command.
  2. The scie-pants.bin binary finds pants.toml, parses the pants_version and determines the proper Python version and then re-launches the scie-pants scie specifying a few env vars to convey what it found and SCIE_BOOT=pants to launch the pants command contained in the scie.
  3. The scie-jump launches the pants command.
  4. The pants console script in the previously installed Pants venv runs.

Each of the 1st 3 steps takes ~300us. The 4th step takes 500ms min (for pants -V for example).

Perhaps there is a way to shim out 4 with something other than the pants console script that runs in consistent time on the order of 1ms or less (like bash -V). Perhaps even that could be avoided.

Right now I just run with RUST_LOG=debug which gives the timings I just described for the 1st 3 steps in log lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#24 now tracks this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will say though to not really worry about this if it feels scary when considering contribution. This is both because the actual scie-pants binary does almost nothing; so its hard to make it slow, and because most feature work will just be, at most, plumbing reading of new toml values from an already priced in pants.toml parse and setting new env vars for sub-processes - both of which are really hard to make slow in non-obvious ways.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The slowest thing it does actually, by almost an order of magnitude, is handle .pants.bootstrap! So this is step 2 which takes ~300us with no .pants.bootstrap and adding in a ~minimal GIT_COMMIT ./pants.bootstrap adds >2000us.

@jsirois jsirois merged commit a3e89d3 into pantsbuild:main Dec 18, 2022
@jsirois jsirois deleted the issues/7/release+contrib branch December 18, 2022 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants