a-file-icon-idea: IDE File explorer is very slow
Describe the bug
While the icons looks great, the IDE becomes very slow while using this plugin. The file explorer takes ages to “lock” on a file when the Select Opened File action is triggered. Also, when creating new folders/files, it takes a very long time before we see it refreshed in the file explorer.
To Reproduce
- Enable the plugin - The larger the project, the slower it gets
- Try to “scope” a file (CMD + F1) or to create a new file
Expected Behavior
File explorer updates should be snappy.
Environment
PhpStorm 2023.2.3
Build #PS-232.10072.32, built on October 13, 2023
Runtime version: 17.0.8.1+7-b1000.32 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.0
GC: G1 Young Generation, G1 Old Generation
Memory: 16000M
Cores: 10
Metal Rendering is ON
Registry:
editor.focus.mode.color.light=415967
ide.editor.tab.selection.animation=true
debugger.new.tool.window.layout=true
ide.animate.toolwindows=true
run.processes.with.pty=TRUE
ide.new.editor.tabs.vertical.borders=true
ide.experimental.ui=true
ide.balloon.shadow.size=0
editor.focus.mode.color.dark=415967
typescript.service.node.arguments=--max_old_space_size=12000
Non-Bundled Plugins:
org.intellij.plugins.hcl (232.8660.88)
com.github.copilot (1.3.2.3479)
org.jetbrains.plugins.go-template (232.9921.89)
com.github.camork.fileExpander (2.3)
com.intellij.kubernetes (232.10072.33)
ru.adelf.idea.dotenv (2023.2)
com.chrisrm.idea.MaterialThemeUI (8.12.6)
com.intellij.lang.jsgraphql (4.0.2)
zielu.gittoolbox (500.0.21+222)
mobi.hsz.idea.gitignore (4.5.2)
Plugin version is 93.1.0
Screenshots
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 9
- Comments: 44
I had already implemented caching in the code a long time ago so this is not that. Moreover, it was running fine a few IDEs ago so this is something newer IDEs have introduced that made it slower.
You’re right about multithreading, but currently the two problems I encounter are 1. The “loading” happening when you open a directory in a large codebase, and 2. the “navigate to file” taking much longer, sometimes to the order of dozens of seconds.
I’ve already profiled the code and nothing pointed to the source of the problem unfortunately, that’s why I said that I’m at loss but since recently I’ve learned about indices and coroutines, I’m willing to give it a try. Unfortunately, this requires focusing and currently I have a lot of work to finish work related so this is taking time to address.
I’d be glad if people wanted to help out… so much for “open-source”…
I will start working on this in this month, it’s pissing me off as well.
I still have no idea how to tackle this issue, I thought maybe either using coroutines, or to use an index. I have no experience in this domain so I’m not sure 🧑🏫
Wow. I had been suffering with this for months. Thought our project had just grown too large. Had to disable your awesome plugin sadly. Any chance there is a fix incoming for this? Happy to help out if you need me to test. Our project is 300k lines Dart monorepo!
I’ll try to see how they implemented it, maybe they are using techniques that I don’t know about.
Yes, I tried them yesterday and they are fast, so it should be possible to have a fast pack. However, I am super used to the colors of this package right now, and all other packages look super-dull (Catpuccin is the second best, but it is a bit too dull/pastel).
Not sure what is causing the slowness. I have the feeling that now the IDE doesn’t load all the project files but only the first level, then load new icons whenever a folder is opened. Since the native IDE doesn’t have a FileIconProvider, it doesn’t need to parse the filename and fetch the icon so it’s faster.
But that doesn’t explain why navigating to the file when clicking on “select opened file” takes ages, it’s as if it is doing something else synchronically before showing the file… very unusable.
I’ve already optimized by keeping a cache of filenames <–> icons when an icon is fetched but like I said, it’s unrelated to the same problem. It’s not the icon loading, it’s the file navigation. I need to understand what is slowing this.
Same applies to my setup. I got here from IntelliJ support ticket, they checked my CPU profile and told me to disable this plugin.
As it was previously 6-15s to create a file, I feel blissful after disabling this plugin now.
I just tested this version and it’s indeed much faster already! The slowness in adding a new file is for me not really noticeable anymore, whilst previously it definitely was. So seems like great improvement already!
I just noticed opening some file trees seems to have a noticeable delay too.
Here is the video for the slowness for adding/removing a file
I had to zoom in since I’m not allowed to share the source code of this project.
https://github.com/user-attachments/assets/6e96e54c-83cf-4152-bf8d-e7f7a0e13423
@mallowigi I looked through some of the code but it’s a little hard to interpret since I am not familiar with jetbrains plugin development. A technique I’ve done before when I’m at a loss of what is causing a lag is to comment out the code and things in piece by piece until the problem occurs again. I’m currently in the same boat with work but I’m willing to spend some time here and there to see if I can help. I took a look at this page https://plugins.jetbrains.com/docs/intellij/developing-plugins.html but I’m trying to figure out what the development flow is. I think this is the page for me to look at? https://plugins.jetbrains.com/docs/intellij/running-and-debugging-a-theme.html#create-plugin-run-configuration
I assume this is a theme but again, I’m unfamiliar.
I’ve also noticed an extreme performance impact. I even blamed PhpStorm for being slow but then somebody told me that this plugin is the cause of it and after disabling the the plugin, it’s super fast to navigate to files.
See https://youtrack.jetbrains.com/issue/WI-74977/Improve-performance-of-Select-Opened-File
I experience it with all projects, however the larger the project, the worse the performance. When I say “unbearable”, I mean seconds. It sometimes takes 5-15 seconds - that’s unusable for any real-life work (IMO)
Sometimes when I reset the IDE it works decently, but after switching between projects or updating many files (git pull, for example), the performance degrades