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

Refactor TreeObserver for performance #4160

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

knutwannheden
Copy link
Contributor

@knutwannheden knutwannheden commented Apr 30, 2024

The TreeObserver mechanism is currently only used by a handful of recipes (FindMethods#find() being the most prominent example which is also used by the AddImport visitor) and only via TreeVisitor#collect(). This use does however not require the diffing functionality as implemented using ObjectDiffer. This turns out to be rather expensive, so this commit makes it an opt-in feature and moves the logic from TreeVisitor into the TreeObserver itself.

The `TreeObserver` mechanism is currently only used by a handful of recipes and only via `TreeVisitor#collect()`. This use does however not require the diffing functionality as implemented using `ObjectDiffer`. This turns out to be rather expensive, so this commit makes it an opt-in feature and moves the logic from `TreeVisitor` into the `TreeObserver` itself.
@knutwannheden knutwannheden changed the title Refactor TreeObserver Refactor TreeObserver for performance Apr 30, 2024
@knutwannheden knutwannheden merged commit fc43e81 into main Apr 30, 2024
1 check passed
@knutwannheden knutwannheden deleted the refactor-observer branch April 30, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants