Skip to content

Use StringSearcher for the text pre-filters of the config and UX CSS indexes - #2923

Merged
Haehnchen merged 1 commit into
Haehnchen:masterfrom
Kocal:perf/index-prefilter-string-searcher
Nov 14, 2026
Merged

Haehnchen merged 1 commit into
Haehnchen:masterfrom
Kocal:perf/index-prefilter-string-searcher

Conversation

@Kocal

@Kocal Kocal commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

ConfigStubIndex and UxCssConfigStubIndex already skip PHP files without twig_component or ux_css, but they check with StringUtil.contains, which compares char by char at every position.

StringSearcher, bundled with the platform, skips ahead by the pattern length and gives the same answer.

On ux.symfony.com (11,295 PHP files), config_stub_index drops from 236-385 ms to 54-58 ms per indexing pass and ux_css_config from 215-386 ms to 91-98 ms, with identical output.

…S indexes

`ConfigStubIndex` and `UxCssConfigStubIndex` already skip PHP files without `twig_component` or `ux_css`, but they check with `StringUtil.contains`, which compares char by char at every position.

`StringSearcher`, bundled with the platform, skips ahead by the pattern length and gives the same answer.

On ux.symfony.com (11,295 PHP files), `config_stub_index` drops from 236-385 ms to 54-58 ms per indexing pass and `ux_css_config` from 215-386 ms to 91-98 ms, with identical output.
@Haehnchen
Haehnchen merged commit f17653c into Haehnchen:master Nov 14, 2026
1 check passed
@Haehnchen

Copy link
Copy Markdown
Owner

👍

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