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

Enable module level caching using the QueryEngine #6228

Closed
JoshuaBatty opened this issue Jul 5, 2024 · 0 comments · Fixed by #6280
Closed

Enable module level caching using the QueryEngine #6228

JoshuaBatty opened this issue Jul 5, 2024 · 0 comments · Fixed by #6280
Assignees
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen language server LSP server performance Everything related to performance, speed wise or memory wise.

Comments

@JoshuaBatty
Copy link
Member

We should be able to enable this with the current setup. We would basically be caching the below type, allowing us to skip compilation for that module if no changes were detected.

#[derive(Clone, Debug)]
pub struct TyModule {
    pub span: Span,
    pub submodules: Vec<(ModName, TySubmodule)>,
    pub namespace: namespace::Namespace,
    pub all_nodes: Vec<TyAstNode>,
    pub attributes: transform::AttributesMap,
}

There will most likely need to be some changes to the garbage collection so we can remove stale types where changed path == SourceId

This should see a pretty dramatic performance increase in the language server for sway projects with lots of files.

@JoshuaBatty JoshuaBatty added language server LSP server compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen performance Everything related to performance, speed wise or memory wise. labels Jul 5, 2024
@JoshuaBatty JoshuaBatty self-assigned this Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen language server LSP server performance Everything related to performance, speed wise or memory wise.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant