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

feat: short-circuit compilation and read build artifacts from file if program is unchanged #2743

Merged
merged 7 commits into from
Sep 20, 2023

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves #2712

Summary*

This PR adds a checksum to CompiledProgram/PreprocessedPrograms which allows nargo to determine whether it can reuse a previously created build artifact in place of performing a full compilation of the source code.

To do this, I've implemented Hash on Program and this hash is included in the build artifact. After monomorphization we recompute this checksum and compare it against the saved build artifact, if they match then we skip compilation and return the old build artifact.

One thing to note is that if you use a cached build artifact for execution then you will not get any debug information. This will be addressed in a followup PR.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@TomAFrench TomAFrench changed the title feat: reuse build artifacts if program is unchanged feat: short-circuit compilation and read build artifacts from file if program is unchanged Sep 18, 2023
kobyhallx
kobyhallx previously approved these changes Sep 19, 2023
@kevaundray kevaundray added this pull request to the merge queue Sep 20, 2023
Merged via the queue into master with commit 87fea4b Sep 20, 2023
17 checks passed
@kevaundray kevaundray deleted the tf/program-hash branch September 20, 2023 23:41
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.

Cache, check and use compiled programs in nargo prove
3 participants