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

Provide names of local variables via FramePointerAnalysis #10906

Merged
merged 39 commits into from
Sep 5, 2024

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Aug 28, 2024

Pull Request Description

Fixes #10843 by enhancing the FramePointerAnalysis pass to compute variableNames for IR nodes that have AliasAnalysis.RootScope or AliasAnalysis.ChildScope.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
  • Unit tests have been written where possible.
  • Benchmarks are fine

@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Aug 28, 2024

With a25b6c7 we are at 1126 cases where we still load AliasAnalysis metadata:

$ ./built-distribution/enso-engine-0.0.0-*/enso-*/bin/enso -run test/Benchmarks/src/Startup/Hello_World.enso 2>&1 | tee out
$ grep ^BAD out  | wc -l
1126

further progress:

@JaroslavTulach
Copy link
Member Author

After fixes made so far I can:

sbt:enso> engine-runner/buildNativeImage

and then:

$ time ./built-distribution/enso-engine-0.0.0-*/enso-*/bin/enso -run test/Benchmarks/src/Startup/Hello_World.enso
real    0m0,827s
user    0m0,687s
sys     0m0,142s

we are able to start Enso with Standard.Base library in less than 1s on my computer. Finally.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Aug 28, 2024
@JaroslavTulach
Copy link
Member Author

After merging with #10899 it is time to do some benchmarking:

val result = symbols()
System.err.println(
"BAD!!!! Computing from scope at " + where + " = " + result
)
Copy link
Member Author

@JaroslavTulach JaroslavTulach Sep 3, 2024

Choose a reason for hiding this comment

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

Let's replace this with Logger and use it in a test to detect no BAD!!! situations happen (when running test/Base_Tests, etc.). Btw. they do happen when using EvalNode and I believe that's necessary as it evaluates random code and needs the LocalScope with AliasGraph.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in c87f67a - use:

./enso --log-level trace --run xyz.enso | grep "] Scope"

to see messages about "Scope computed from AliasAnalysis".

@JaroslavTulach
Copy link
Member Author

Startup benchmarks seem to be fine. There is 100ms speedup in the most complicated one:

Startup_import_world

there is half of the speedup in Hello World via IO.println. There is no regression in Hello World without any libraries.

@JaroslavTulach JaroslavTulach added the CI: Clean build required CI runners will be cleaned before and after this PR is built. label Sep 4, 2024
Copy link
Member

@Akirathan Akirathan left a comment

Choose a reason for hiding this comment

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

Nice to see at least some improvement. Although we all have expected a bigger improvement, because of the size of AliasAnalysis, but at least something. Some nits.

Copy link
Contributor

@hubertp hubertp left a comment

Choose a reason for hiding this comment

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

mostly nits

JaroslavTulach and others added 7 commits September 4, 2024 17:07
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
@JaroslavTulach JaroslavTulach merged commit d37b8f3 into develop Sep 5, 2024
41 checks passed
@JaroslavTulach JaroslavTulach deleted the wip/jtulach/FrameInfo10843 branch September 5, 2024 08:02
jdunkerley pushed a commit that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speedup EnsoRootNode.buildFrameDescriptor
3 participants