[occurrences] Store modules' shapes in env sumaries#11983
Closed
voodoos wants to merge 1 commit intoocaml:trunkfrom
Closed
[occurrences] Store modules' shapes in env sumaries#11983voodoos wants to merge 1 commit intoocaml:trunkfrom
voodoos wants to merge 1 commit intoocaml:trunkfrom
Conversation
Contributor
Author
|
A fourth option would be to add a new flag |
Contributor
|
I think that it would be worth prototyping 3 if you can. I suspect it is the best approach, but we really need to see some performance and memory size numbers to be sure. |
Contributor
Author
|
Closing in favor of #12142 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the shapes were introduced into the compiler it was primarily with the goal of supporting
jump-to-definition. For this purpose, visible shapes of compilation units where added to the cmt files and Merlin use these when reducing a value's shape to find its definition.However, when indexing the code-base to provide project-wide occurrences having only the shape of the top-level of the compilation unit is not sufficient: one have to iterate over values in the cmt's Typedtree and reduce their shapes and that reduction require access to intermediate modules' shapes.
However, naively adding the shapes to the summaries impact the cmt filesize a lot. On Irmin, with this PR, it goes from 190M to 522M. This is the reason why I opened this PR as a draft, so that we can discuss options.
For now I have little hopes for 1, and will have a try at 2 since it sounds less invasive than 3. Any comments / ideas are welcome :-)