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

[NFC] Make Precompute use a lazy LocalGraph #6934

Merged
merged 18 commits into from
Sep 12, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Sep 12, 2024

To do this, add locations and getInfluences to LazyLocalGraph. Both cannot
really be computed in a fine-grained manner, so just compute them all on the
first request. That is not as efficient as our lazy computation of getSets and
setInfluences, but they are also less important, and this change makes the
pass 20% faster.

Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

Since the computation isn't lazy in a fine-grained way that pessimizes performance when all the information will be needed, would it make sense to compute these on demand for all LocalGraphs and not just lazy ones?

Other than that question, LGTM.

@kripken
Copy link
Member Author

kripken commented Sep 12, 2024

I think maybe not, since laziness has a cost, even if small. If you know you will definitely need getInfluences then the branch on "have I lazily computed them" is wasteful, even if it is well-predicted.

@kripken kripken merged commit 0888f9c into WebAssembly:main Sep 12, 2024
13 checks passed
@kripken kripken deleted the precompute.efficient.3 branch September 12, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants