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

Do no compile library items that are not used #2873

Open
mohammadfawaz opened this issue Sep 27, 2022 · 2 comments
Open

Do no compile library items that are not used #2873

mohammadfawaz opened this issue Sep 27, 2022 · 2 comments
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser P: high Should be looked at if there are no critical issues left

Comments

@mohammadfawaz
Copy link
Contributor

We could do this in two steps:

  1. Do not compile whole libraries that are not needed (or transitively needed) by the entry program.
  2. Do not compile library items that are not needed (or transitively needed) by the entry program.

(2) will become easier when the collection context work is complete (I think).

@mohammadfawaz mohammadfawaz added P: high Should be looked at if there are no critical issues left compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser labels Sep 27, 2022
@otrho
Copy link
Contributor

otrho commented Sep 27, 2022

(1) is already kinda handled by Forc.toml isn't it? We only compile the libraries in there before providing them to the entry. I guess transitive dependencies of 'whole' libraries still happens unnecessarily, but that sort of analysis might also require the CC.

@mohammadfawaz
Copy link
Contributor Author

Yeah thinking about "sub-libraries" of the standard library here as an example. If the top level program does not need assert anywhere, even transitively, then don't compile the assert library.

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 compiler: parser Everything to do with the parser P: high Should be looked at if there are no critical issues left
Projects
None yet
Development

No branches or pull requests

2 participants