Skip to content

Skip PHP files without routes in the routes index - #2920

Merged
Haehnchen merged 1 commit into
Haehnchen:masterfrom
Kocal:perf/routes-object-prefilter
Nov 14, 2026
Merged

Haehnchen merged 1 commit into
Haehnchen:masterfrom
Kocal:perf/routes-object-prefilter

Conversation

@Kocal

@Kocal Kocal commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

For PHP files, RoutesStubIndex visits every class and walks the whole PSI tree looking for RoutingConfigurator closures. It is the most expensive index of the plugin.

It now returns early, using StringSearcher, unless the content contains RoutingConfigurator or route in any case. The match is case-insensitive because Route annotations and attributes are matched case-insensitively.

Two new tests cover a fluent file that never mentions route and an upper-case ROUTE attribute. On ux.symfony.com (11,295 PHP files), the index takes 316-335 ms per indexing pass instead of 1,246-1,493 ms, with identical output for every file.

For PHP files, `RoutesStubIndex` visits every class and walks the whole PSI tree looking for `RoutingConfigurator` closures. It is the most expensive index of the plugin.

It now returns early, using `StringSearcher`, unless the content contains `RoutingConfigurator` or `route` in any case. The match is case-insensitive because `Route` annotations and attributes are matched case-insensitively.

Two new tests cover a fluent file that never mentions `route` and an upper-case `ROUTE` attribute. On ux.symfony.com (11,295 PHP files), the index takes 316-335 ms per indexing pass instead of 1,246-1,493 ms, with identical output for every file.
@Haehnchen

Copy link
Copy Markdown
Owner

👍

@Haehnchen
Haehnchen merged commit 440ca3d into Haehnchen:master Nov 14, 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