Skip to content

Skip PHP files without a services marker in the services definition index - #2925

Merged
Haehnchen merged 1 commit into
Haehnchen:masterfrom
Kocal:perf/service-definition-text-scan
Nov 15, 2026
Merged

Haehnchen merged 1 commit into
Haehnchen:masterfrom
Kocal:perf/service-definition-text-scan

Conversation

@Kocal

@Kocal Kocal commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

ServicesDefinitionStubIndex ran its path validation and the service lookup (control flow of every namespace and every class method) on every PHP file. A PHP file can only define services through a services array key or a ContainerConfigurator parameter, so it must contain services or Configurator.

The index now returns early otherwise, before the path validation. XML and YAML files are unaffected, and a new test covers a plain PHP array config file that never mentions Configurator.

On ux.symfony.com (11,295 PHP files), the index takes 103-115 ms per indexing pass instead of 244-270 ms, with identical output for every file.

…ndex

`ServicesDefinitionStubIndex` ran its path validation and the service lookup (control flow of every namespace and every class method) on every PHP file. A PHP file can only define services through a `services` array key or a `ContainerConfigurator` parameter, so it must contain `services` or `Configurator`.

The index now returns early otherwise, before the path validation. XML and YAML files are unaffected, and a new test covers a plain PHP array config file that never mentions `Configurator`.

On ux.symfony.com (11,295 PHP files), the index takes 103-115 ms per indexing pass instead of 244-270 ms, with identical output for every file.
@Haehnchen
Haehnchen merged commit f2b8c85 into Haehnchen:master Nov 15, 2026
1 check passed
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.

2 participants