Skip to content

Faster service lookups after a signature edit - #568

Merged
AJenbo merged 1 commit into
PHPantom-dev:mainfrom
giuseppe-esposito-87:fix-container-index-rebuild
Nov 12, 2026
Merged

AJenbo merged 1 commit into
PHPantom-dev:mainfrom
giuseppe-esposito-87:fix-container-index-rebuild

Conversation

@giuseppe-esposito-87

Copy link
Copy Markdown
Contributor

🤖 This was written by an AI agent on behalf of @giuseppe-esposito-87 (claude-code/claude-opus-5-5).

Speeds up the first service lookup after an edit that changes a method signature, in a workspace with Symfony PHP configuration. Building the container index confirms the configuration's calls, and every lookup made while confirming one built the whole index again. The index is now built once per configuration file being confirmed, with the same answers.

In the repository root, which holds the Symfony and Drupal playgrounds, going to the definition of a Drupal plugin ID 2 seconds after such an edit takes about 1.1 s instead of 2.2 to 3.4 s. On Drupal core 11.4 and on the redirect and flag modules, analyze reports exactly what main reports, and the Drupal and Symfony completion benchmarks pass.

How to test: open the repository root with this branch's build and open examples/drupal/web/modules/custom/acme/src/Controller/GreetingController.php. In NoteCounter.php next to it, change count(): int to count(): ?int, then go to the definition of 'acme_greeting_block' in block().

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, examples/). Not applicable: no documented behaviour changes.
  • I have updated the config schema (config-schema.json). Not applicable: this PR adds or changes no setting.
  • I have added/updated tests to cover my changes
  • If I used AI tools, I have reviewed what they produced and can explain
    the changes and why they are needed.
  • I have read through any AI-generated text, especially documentation,
    the changelog, and other user-facing content, and removed or corrected
    anything inaccurate, unclear, or unnecessary.

Building the container index confirms the configurator files, and a
lookup made while confirming one asks for the index again. Nothing built
meanwhile is kept, so every such lookup built the whole index again,
nested as deep as the files being confirmed. Keep each index a thread
builds while confirming files, keyed by those files, and reuse it for
the next lookup made while the same files are being confirmed: the
answers stay the same, and the index is built once per set of files
being confirmed instead of once per lookup.

Assisted-by: claude-code/claude-opus-5-5
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AJenbo
AJenbo merged commit 5ffa20b into PHPantom-dev:main Nov 12, 2026
20 of 21 checks passed
@AJenbo

AJenbo commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Thanks

@giuseppe-esposito-87
giuseppe-esposito-87 deleted the fix-container-index-rebuild branch November 16, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants