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

refactor: optimize compile speed (skip fetch deps) #20

Conversation

Rqnsom
Copy link
Member

@Rqnsom Rqnsom commented Sep 12, 2024

Optimization takes use of the skip-fetch-latest-git-deps compilation flag.
Regardless of this flag, by default - if no deps are found in the
/Users/$USER/.move directory (a cache folder for Move packages)
the missing packages will be downloaded there.

But if the cache exists, then the skip-fetch-latest-git-deps flag can
be used to skip checking whether those cached Move packages ought to be
updated.

In this PR - for the first compilation step (checking that the original
tests are working fine), we disable that flag and ensure we get the
latest Move packages.
Then, for all subsequent compilations (mutant generation and running
tests on those mutants), the tool enables that flag since it doesn't
make much sense to check the latest deps repeatedly - checking it only
once when the tool is started, it should be good enough.

Note: there is a x5 compilation speed increase here.


Additional PR is included here:

chore: switch to aptos stdlib in tests

  • till now, we used Stdlib from the move repo:
MoveStdlib = { git = "https://github.com/move-language/move.git", subdir = "language/move-stdlib", rev = "main" }
  • the right approach is to use aptos stdlib:
[dependencies.AptosStdlib]
git = 'https://github.com/aptos-labs/aptos-core.git'
rev = 'main'
subdir = 'aptos-move/framework/aptos-stdlib'

- till now, we used Stdlib from the `move` repo:
```
MoveStdlib = { git = "https://github.com/move-language/move.git", subdir = "language/move-stdlib", rev = "main" }
```

- the right approach is to use aptos stdlib:
```
[dependencies.AptosStdlib]
git = 'https://github.com/aptos-labs/aptos-core.git'
rev = 'main'
subdir = 'aptos-move/framework/aptos-stdlib'
```
@Rqnsom Rqnsom added the refactor Refactoring label Sep 12, 2024
@Rqnsom Rqnsom added this to the Milestone 1 milestone Sep 12, 2024
@Rqnsom Rqnsom requested a review from asmie September 12, 2024 11:26
@Rqnsom Rqnsom self-assigned this Sep 12, 2024
@Rqnsom Rqnsom force-pushed the develop/refactor/speed-up-the-compilation-with-skip-fetch-latest-deps-flag branch 2 times, most recently from 601f5f3 to 03f7dea Compare September 12, 2024 17:06
Optimization takes use of the `skip-fetch-latest-git-deps` compilation flag.
Regardless of this flag, by default - if no deps are found in the
`/Users/$USER/.move` directory (a cache folder for Move packages)
the missing packages will be downloaded there.

But if the cache exists, then the `skip-fetch-latest-git-deps` flag can
be used to skip checking whether those cached Move packages ought to be
updated.

In this PR - for the first compilation step (checking that the original
tests are working fine), we disable that flag and ensure we get the
latest Move packages.
Then, for all subsequent compilations (mutant generation and running
tests on those mutants), the tool enables that flag since it doesn't
make much sense to check the latest deps repeatedly - checking it only
once when the tool is started - it should be good enough.
@Rqnsom Rqnsom force-pushed the develop/refactor/speed-up-the-compilation-with-skip-fetch-latest-deps-flag branch from 03f7dea to 1017643 Compare September 12, 2024 17:10
Copy link
Member

@asmie asmie left a comment

Choose a reason for hiding this comment

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

LGTM!
Haven't run it to check the perf but code looks fine!

@Rqnsom Rqnsom merged commit 8e4141d into develop-m1 Sep 13, 2024
1 check passed
@Rqnsom Rqnsom deleted the develop/refactor/speed-up-the-compilation-with-skip-fetch-latest-deps-flag branch September 13, 2024 06:01
@Rqnsom Rqnsom mentioned this pull request Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants