File indexing slowing down UI

I am aware that the ability to search for text inside files comes at a cost. I understand that files have to be indexed from time to time for this feature to work. I'm actually used to it, because as far as I can remember, it has always been this way. At some point, your laptop would become noisy for a couple of minutes, I don't mind that.

In a moderately large project (and I don't work with any other), switching from one branch to another triggers indexing. And again, I'm fine with that, as long as it doesn't slow down the UI. But unfortunately, it does. Back when I started using PhpStorm, indexing was something that would be done in the background. I don't know when exactly it changed, but recently it feels more and more like a foreground thing. After you switch from feature to master and indexing starts, you can barely write anything in the editor or in the terminal.

 

A couple of additional observations.

  • Sometimes the differences between the branches are minimal, yet indexing still takes a while. This creates a feeling that the process is not optimized.
  • I'm not sure if memory is a key factor during indexing, yet it's frustrating when you see that PhpStorm is using 20% of its quota, but at the same time allows you to type 10 characters per minute.

     

And just in case:

  • I know I can exclude files from indexing. Rest assured that all directories that I don't need to be searchable are excluded.
  • The projects aren't huge either. We're talking about a typical Magento project here.
  • I tested it on a fresh install of 2025.2.5 (if you can't reproduce it, your project just doesn't have enough files).

Any tips and tricks that you recommend?
Any plans to optimize file indexing in the future?

 

0

Yeah, branch switch indexing killing the UI sucks, especially on Magento.

Quick fixes that actually work:
- Settings → Tools → Branch Switch Indexing → enable “Skip files with many indexed paths” (set ~500)
- Bump heap to 4g + add `-Dide.indexing.threads=4` in idea.properties
- Invalidate caches once if it’s being extra dumb

2025.3 is bringing proper low-priority indexing so the editor stays responsive. Hang in there!

-2

Hi,

It seems the previous comment was generated by AI, so please ignore it.

Could you please switch to another branch, go to the IDE main menu Help | Diagnostic Tools | Start CPU Usage Profiling.

  1. Reproduce the slow problem you’ve experienced several times in 1-2 minutes.
  2. Go back to the main menu and select Help | Diagnostic Tools | Stop CPU Usage Profiling.
  3. Upload the generated file from https://uploads.jetbrains.com/ and share us the upload it.

 

Another possible cause is that your laptop overheats more when most cores are used after being used for a few years (e.g., due to dust buildup).

In the IDEA, you could use the below ways to reduce the CPU usage for indexing which should help workaround your issue:

  • Add caches.indexerThreadsCount=x in the Help | Edit Custom Properties file and restart the IDE to configure how many threads are used for indexing.
    x means the thread number here.
    For example, you could add caches.indexerThreadsCount=2 to let guide the IDE to use 2 threads for indexing.
  • Click the IDE main menu Help | Edit Custom VM Options, add something like -XX:ActiveProcessorCount=x in a new line, and restart the IDEA.
    The x value overrides the number of CPUs that the VM detects and uses when creating threads for various operations.
    For example, if you use 4 for x, the IDE will think your computer has 4 cores. This is the way you want to control the total CPU the IDE uses for all features.
0

Thank you for taking the time to answer.

I think I'll keep observing it for a while.

I wouldn't say it's the laptop, because it's only PhpStorm that's slowing down.

With 2025.3 I don't see the “Indexing” notification that often.
But this version feels more laggy in general (even if you don't perform any VC operations) - especially in the terminal.

 

0
> But this version feels more laggy in general (even if you don't perform any VC operations) - especially in the terminal.

It would be nice if you could provide more details. Does typing feel laggy in the Terminal, or are you experiencing other issues?
Does the IDE freeze for a short time, like 2–3 seconds?

If you can easily reproduce this laggy issue, please click the IDE main menu `Help | Diagnostic Tools | Start CPU Usage Profiling`, reproduce this slow issue 2-3 times in a short time, click `Help | Diagnostic Tools | Stop CPU Usage Profiling` to get the CPU snapshots, upload it under https://uploads.jetbrains.com/, and share us the upload it for investigation.
0

> Does the IDE freeze for a short time, like 2–3 seconds?

I wouldn't say it's 2-3 seconds; at least the lag of this kind doesn't happen often. But as an average person types 5-6 characters per second, even a lag of 100 ms can make a difference. Most of the time it's probably in the range of 0 to 500 ms, sometimes it may go up to maybe around 1000 ms. That's why I wrote that it “feels laggy". It's not that I press a key and go to make myself a cup of coffee.

I noticed that it behaves differently from the old terminal, though. This one seems to remember what you type. Which occasionally makes it go behind. Sometimes by 2-3 characters, but sometimes by even 10 to 15. It appears to try to be “clever” and do something in the background (guess git branches or whatever). Sometimes it's even hard to tell what it's trying to accomplish (note how the text changes when I type `lgsd..` in the attached screen capture). 
 

 

 

0
Can you please try to disable the `File | Settings | Tools | Terminal | Command Completion` to see if it helps to work around your slow typing issue in Terminal?
0

I turned command completion off, but the particular issue (the one from the gif above) persists.

0

Another annoying thing is that if I switch from branch A to branch B, then from branch B back to branch A, and so on, indexing starts each time. And every time it starts, it slows down the terminal and UI in general. I'd expect it to be smarter than that - being able to figure out if there were any changes since the last indexing. But the underlying problem is still the same: indexing should be done in the background, so that the user can do something while it lasts.

 

 

0
It seems your GIF issue is caused by the type-ahead predictions we have added in 2025.3 to the terminal. The related bug report is here: https://youtrack.jetbrains.com/issue/IJPL-217982

Please select `Help | Find Action` from the main menu, type `Registry...`, select it, and in the opened list, find and disable the `terminal.type.ahead` option there (you can type `terminaltype` directly in the opened list to find it in this registry dialog) to see if it helps.

> indexing starts each time. And every time it starts, it slows down the terminal and UI in general.

The indexing already starts in the background, but there are known issues that can cause it to be slow:
1. There are some locks used to synchronize core data between the UI thread and background threads, which may slow down the UI when indexing is in progress. (There are ongoing efforts to remove some locks to improve UI responsiveness.) 2. The indexing background thread tries to use most CPU cores to finish faster.

Have you tried my suggestion here https://intellij-support.jetbrains.com/hc/en-us/community/posts/31382989028242/comments/31748955669394 to use `caches.indexerThreadsCount=x` to let the indexing feature use less cores for the point 2 I meationed above.
0

请先登录再写评论。