Open ssigwart opened 5 years ago
I feel like you might plainly be throwing too much at the IDE to handle here. No doubt we can optimize things further, but at a certain point we will say "this is just unrealistic, please scope down your project".
All of this is to say, can you point Komodo at JUST the file you're actually working with? I feel often people just point their IDE at a top level folder and go to work. This is basically telling Komodo "I am working with ALL THE FILES that I'm currently pointing you at (ie. the top level of your project). A better way to approach this is to point it just at the specific files you're working with OR by adding excludes to your project configuration, which tells Komodo "Don't worry about these files". Your vendor folder would generally be a good one to add to your excludes.
Does this sound reasonable, or would you say that the amount of files you're pointing Komodo at is not that large? Any context you could give us on the project you're working on?
Thanks for the response.
It is fairly large, but I wouldn't say it's massive. I have tried in both Edit and IDE to add as many excludes as possible ("node_modules", "vendor", etc.). The project folder has about 36,000 files. However, after the excludes, it's down to a little over 12,000. Breaking it down to file types, it's
Language | Count |
---|---|
PHP | ~2,200 |
Smarty | ~2,800 |
CSS | < 50 |
SCSS | ~400 |
Javascript | ~500 |
SQL | ~1,300 |
Bash | ~325 |
One issue is I don't believe I can exclude something like "static/img". I'd have to exclude "img", right? Images account for about 4,000 files. There are other places where I'd like to exclude a specific folder too, but the folder name is not unique.
@Naatan, I believe I found a bug that causes Python to use 100% CPU. When using namespaces, particularly something like use \Exception;
, I'm able to duplicate the CPU issue. Somehow, /Applications/Komodo IDE 11.app/Contents/Resources/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/legacy/php/import_resolver.py
winds up with import_symbol.type
starting with \\
. That means that the following line eventually results in a search for an empty string (since name_parts[0]
is blank):
name_parts = import_symbol.type.split("\\")
If I change it to the following, it seems much better:
name_parts = import_symbol.type.lstrip("\\").split("\\")
Very nice digging, I'm impressed! Does that tweak resolve your issue or simply somewhat reduce it?
It resolves the worst of the issues with 100% CPU in that case. In working today, I've had it hit 100% a few times, but not for as long of a duration. I'll have to debug some more later as it seems to be a different issue. There's still a little lag in suggestions or they won't show sometimes, but I can live with that.
Very cool. Thanks for sharing! We'll do some testing and get it in the next release.
It's still been getting sluggish, but I've also found a few simple optimizations that seem pretty safe to me and seem to have at least some benefit. I'm not sure if you give people access to the IDE repo, but if you do, I can add them in a branch. If not, I can add them in the comments here when I get some time.
Unfortunately IDE is not open-source. We would surely appreciate any tweaks you could contribute, although I guess technically the license may prohibit this. Feel free to send it to support@activestate.com if you want to be safe.
Test case to check when changes are implemented: https://github.com/Komodo/KomodoEdit/issues/3380
Short Summary
On MacOS, Komodo gets excessively laggy when typing, scrolling, or clicking in the UI. At times, I can type up to 4 or 5 words of a sentence before the characters start displaying. In general, Komodo seems to use a lot of CPU, but at times, things seem to hang and a Python process with use 100% for a while. Also, #3639 is an issue for me on Komodo IDE too.
Steps to Reproduce
I think you'll need to use a fairly large project and work on it for a fair amount of time. Sometimes, there are issues within a few minutes. Other times, it can be around an hour or more.
Expected results
Actual results
Platform Information
Additional Information
I tried various configurations of the Code Intelligence settings. Below are my findings:
I noticed a few times that the Symbol Browser would hang showing the loading icon. This coincided with Python using 100% CPU many of the times I saw it. I'm not sure if it was every time Python used 100% or just a side effect.
When closing the app, it seems to take around 5 - 10 seconds for the app to show as closed in the macOS dock.
Settings Corresponding with the Logs Shown Below
I feel like this issue may be related to CodeIntel. Currently,
codeintel3.db
is 116MB. Incodeintel3.log
, I noticed the below logged a lot. Manually running this query, there are ~3,500 results.Also, codeintel seems to be killed and restarted a lot:
Here is the output of pystderr.log.
I also have Activity Monitor samples of the Python process at 2 different times when it was at 100% CPU. I can send them if you need them.
I tried to add as much info as I could. Hopefully this is helpful. Please let me know if you need any more information.