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

perf(es/minifier): Add cache for collect_infects_from #9924

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jan 22, 2025

Description:

Note: This is conceptually correct, but currently it degrades the performance.

@kdy1 kdy1 added this to the Planned milestone Jan 22, 2025
@kdy1 kdy1 self-assigned this Jan 22, 2025
Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: c2479cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kdy1
Copy link
Member Author

kdy1 commented Jan 22, 2025

cc @CPunisher Do you have an idea for better caching? *const Function does not look good to me.

@CPunisher
Copy link
Member

CPunisher commented Jan 23, 2025

cc @CPunisher Do you have an idea for better caching? *const Function does not look good to me.

The point is to determine an unique id for a function node. Maybe Ident, Span...Since we don't have node id, we may need to find the unique id based on the context.

BTW does it handle a node many times?

@kdy1
Copy link
Member Author

kdy1 commented Jan 23, 2025

@CPunisher Yeap. I wrote about them in #9927.

While visiting nodes for usage analysis, it calls collect_infects_from on the node, but while recursing into a node from the usage analyzer, it calls collect_infects_from on a child node again.

@CPunisher
Copy link
Member

@CPunisher Yeap. I wrote about them in #9927.

While visiting nodes for usage analysis, it calls collect_infects_from on the node, but while recursing into a node from the usage analyzer, it calls collect_infects_from on a child node again.

I see. If it is hard to cache the result, can we avoid repeated analysis? That means we can stop collect_infects_from going deeper since we know we will handle inner nodes later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants