Skip to content

[perf] Avoid nested traversals in ByRefNodeVisitor by tracking by-ref variable names per FunctionLike - #8879

Merged
TomasVotruba merged 2 commits into
mainfrom
avoid-nested-ref
Oct 28, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
avoid-nested-ref

Conversation

@samsonasik

Copy link
Copy Markdown
Member

ByRefNodeVisitor runs inside the main decorating traversal, but it started a second traversal over the same nodes. This PR reduce them.

Benchmark tested on bench/by_ref_node_visitor_bench.php

main this PR
per traverse ~26.1 ms ~9.2 ms

@samsonasik samsonasik changed the title Avoid nested ref [perf] Avoid nested traversals in ByRefNodeVisitor by tracking by-ref variable names per FunctionLike Oct 28, 2026
@TomasVotruba
TomasVotruba merged commit e291f0d into main Oct 28, 2026
51 checks passed
@TomasVotruba

Copy link
Copy Markdown
Member

LGTM

@TomasVotruba
TomasVotruba deleted the avoid-nested-ref branch October 28, 2026 18:40
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