-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[move-compiler] A leaner version of pre-compiled libs #22422
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
@@ -19,7 +19,7 @@ function version(path: string, args?: readonly string[]): string | null { | |||
const versionString = childProcess.spawnSync( | |||
path, args, { encoding: 'utf8' }, | |||
); | |||
return versionString.stdout; | |||
return versionString.stdout || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated change fixing a problem discovered when debugging move-analyzer
changes for this PR
@@ -195,6 +195,14 @@ impl<'a> ParsingAnalysisContext<'a> { | |||
assert!(self.current_mod_ident_str.is_none()); | |||
self.current_mod_ident_str = Some(mod_ident_str.clone()); | |||
|
|||
if mod_use_defs.get(&mod_ident_str).is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This did not need handling before as we were doing compilation with pre-compiled libraries right from the start. Now we do the first. Now we do first compilation without pre-compiled libraries as explained in the PR description.
7f71e86
to
3bedb91
Compare
3bedb91
to
305fa04
Compare
Description
This PR replaces
FullyCompiledProgram
used for testing and in to speed up compilation inmove-analyzer
with a much leaner per-moduleCompiledModuleInfo
structure.The effect on
move-analyzer
's memory consumption is quite dramatic - for a single package with default dependencies, memory footprint shrinks to ~350M vs. 1.4GB before this optimization was implemented.The changes to
move-analyzer
are more involved than simply swappingFullyCompiledProgram
withCompiledModuleInfo
for the following reason. Prior to this PR we could use pre-compiled dependencies during first compilation as it contained full parsing and typing ASTs that could be directly plugged into the analysis even though the pre-analyzed dependencies were not available during this first compilation. Now we no longer have full ASTs available so we do the first compilation without pre-compiled dependencies (so that full ASTs for both user program and dependencies can be produced), and use both pre-compiled dependencies (for faster compilation) and pre-analyzed dependencies (to avoid re-analyzing them) during subsequent compilations. This results in the first compilation to be slower but I'd say it's an acceptable trade-offTest plan
All CI tests must pass. Tested
move-analyzer
modifications manually