Skip to content

perf: More efficient computation of used symbols#4582

Merged
clason merged 1 commit intorelease-0.25from
backport-4568-to-release-0.25
Jul 10, 2025
Merged

perf: More efficient computation of used symbols#4582
clason merged 1 commit intorelease-0.25from
backport-4568-to-release-0.25

Conversation

@tree-sitter-ci-bot
Copy link

Description

Backport of #4568 to release-0.25.

As the call to `symbol_is_used` does not depend
on the production, it is more efficient to call it
only once outside the loop over productions.

I'm not sure if `rustc` is able to do this optimization
on its own (it would need to know that the function
is pure, which sounds difficult in general).

(cherry picked from commit 36d93ae)
@clason clason merged commit 3bd8f7d into release-0.25 Jul 10, 2025
18 checks passed
@clason clason deleted the backport-4568-to-release-0.25 branch July 10, 2025 07:25
@tree-sitter tree-sitter deleted a comment Aug 13, 2025
@tree-sitter tree-sitter deleted a comment Aug 13, 2025
@tree-sitter tree-sitter locked as spam and limited conversation to collaborators Aug 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants