odoo-ide / pycharm-odoo

PyCharm plugin for Odoo
https://plugins.jetbrains.com/plugin/13499-odoo
Other
41 stars 5 forks source link

Index performance on readonly filesystem #472

Open davejames opened 1 month ago

davejames commented 1 month ago

Hello, when using the plugin in combination with a python environment instantiated with Nix, pycharm takes a long time to finish indexing. I couldn't see anything in the logs that might shed any light on what it's getting stuck on, but it's during the "scanning python SDK" stage, once this completes, the indexing itself doesn't take too long.

image

While this is happening the process manager shows vfs and the odoo plugin consuming significant CPU

image

Is there any way I can narrow down what's happening here? I didn't see any logging at this point indicating what the plugin is trying to do.

This is a fairly non-standard setup as python is in a readonly filesystem (nix store), however without the odoo plugin installed indexing works normally. Are there any considerations we might need to make for a readonly python environment?

trinhanhngoc commented 1 month ago

Hello @davejames ,

The Odoo plugin needs to index some additional data, such as modules, models, fields, xml ids,... to work properly. This indeed requires more time for indexing to complete. I don't think that there is any performance difference with a readonly filesystem because indexing is a read action. Anyway, indexing may take a long time the first time you open a project. Once complete, indexing will only occur with new or changed files, so it will not affect performance.

davejames commented 1 month ago

Thanks for the reply, sorry I probably wasn't too clear, we're talking about excessive index times here, the CPU is thrashed for up to an hour before it eventually completes. And this is before the codebase itself is indexed, this happens during indexing of the python SDK, and only if the Odoo plugin is enabled.

Is there any way I can determine what the plugin is doing for all that time so that I can report back with more helpful information?

trinhanhngoc commented 1 month ago

@davejames ,

JetBrains devs often need some logs from Help | Collect Logs and Diagnostic Data after reproducing the issue. I am sure the only heavy processes in the Odoo plugin are index reading.