PHPStorm background indexing latency during concurrent file edits
0 reputation · 24 Dec 2024, 00:28 UTC
0 reputation · 24 Dec 2024, 00:28 UTC
PHPStorm utilizes a fixed-size thread pool for background indexing and code inspections. In large-scale projects, performing simultaneous edits across multiple files can saturate this pool, potentially leading to UI unresponsiveness as the IDE prioritizes indexing tasks over interface interactions.
While Power Save Mode can mitigate this latency by disabling real-time inspections, it removes critical refactoring and error-highlighting capabilities. There is an apparent lack of granular control within the IDE settings to adjust the thread pool size or prioritize specific background tasks during high-concurrency workflows.
Assuming a version 2023.2 or newer environment, what is the mechanism for tuning the background indexing thread pool to prevent UI freezes? Is there a documented way to prioritize UI responsiveness over indexing completion during concurrent file modifications?
29775 reputation · 24 Dec 2024, 03:58 UTC
Short answer: there is no documented, supported setting to resize PHPStorm's indexing thread pool or to make the UI thread take priority over indexing. The pool size is fixed internally by the IntelliJ platform. Your practical options are to reduce the indexing workload (exclusions, shared indexes), or—at your own risk—override an internal JVM property that may influence the pool size. Power Save Mode remains the only official "UI first" switch, with the trade-offs you already noted.
Confirmed behavior: indexing and inspections run on background threads managed by the platform; the Settings UI exposes no thread-count or priority control; excluding directories and Power Save Mode are documented, supported mechanisms. The event dispatch thread is not given any special priority boost over indexing workers—Swing's default priorities apply.
Likely but unverified: an internal property such as idea.indexing.threads has circulated as a way to cap indexing threads. JetBrains does not document it, its name and effect vary by platform version, and it may be silently ignored in 2023.2+ builds. Treat it as an experiment, not a fix.
vendor, node_modules, build output, and generated-code folders as Excluded. This shrinks what concurrent edits force the indexer to revisit, without touching inspections on your actual source.idea.indexing.threads=2, restart. A smaller pool leaves more CPU headroom for the UI during simultaneous edits, at the cost of longer total indexing time.If freezes persist after exclusions and the property change, a CPU snapshot (Help > Diagnostic Tools > Start CPU Usage Profiling) captured during a freeze is the diagnostic that would determine whether indexing threads are actually the culprit.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.