Skip to content

Use more efficient AttributeParentConnectingVisitor #1074

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

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 26, 2025

1:1 copy of php-parsers ParentConnectingVisitor but optimized for our use-case

after PR

➜  php-code-coverage git:(attr-paren) ✗ hyperfine --prepare 'rm -rf /tmp/coverage-cache' 'php test.php'
Benchmark 1: php test.php
  Time (mean ± σ):     159.4 ms ±   1.2 ms    [User: 137.7 ms, System: 18.9 ms]
  Range (min … max):   156.2 ms … 161.1 ms    18 runs

before PR

➜  php-code-coverage git:(attr-paren) ✗ hyperfine --prepare 'rm -rf /tmp/coverage-cache' 'php test.php'
Benchmark 1: php test.php
  Time (mean ± σ):     163.0 ms ±   1.1 ms    [User: 140.1 ms, System: 19.9 ms]
  Range (min … max):   161.1 ms … 164.8 ms    17 runs

refs #1072 (comment)

Less references between AST nodes mean less work for GC

@staabm staabm force-pushed the attr-paren branch 3 times, most recently from 00f7b39 to 5bf9a1b Compare April 26, 2025 17:31
@staabm staabm marked this pull request as ready for review April 26, 2025 17:33
@staabm staabm force-pushed the attr-paren branch 2 times, most recently from c3b51f4 to c3dbc7f Compare April 26, 2025 17:39
@sebastianbergmann sebastianbergmann merged commit 15197b8 into sebastianbergmann:main Apr 28, 2025
16 checks passed
@sebastianbergmann sebastianbergmann changed the title Use more efficient AttributeParentConnectingVisitor Use more efficient AttributeParentConnectingVisitor Apr 28, 2025
@staabm staabm deleted the attr-paren branch April 28, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants