User Preferences "Addons" panel bogs down the whole interface #36387

Closed
opened 2013-08-05 15:10:30 +02:00 by step-ani-motion · 17 comments

%%%--- Operating System, Graphics card ---
Win7, Quadro 4000/Geforce GTX 680

- Blender version with error ---

2.68.1 r58588

- Short description of error ---

The "Addons" panel in the "User Preferences" window seems to read the entire script library on every GHOST event happening in that panel. Just moving the mouse from one element to another, e.g. mouse over background -> mouse over search panel, triggers blender to reread all scripts.

I tested this with ProcessMonitor and the attached config.

This behavior is especially bad with blender installed on a global network drive.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---
  • open ProcessMonitor (http://technet.microsoft.com/en-us/sysinternals/bb896645) and import the attached configuration
  • open blender
  • open the addons panel in the user preferences window
  • move your mouse over different elements (search field, category filter fields ...)
  • observe a full script library re-read at every focus change

%%%

%%%--- Operating System, Graphics card --- Win7, Quadro 4000/Geforce GTX 680 - Blender version with error --- 2.68.1 r58588 - Short description of error --- The "Addons" panel in the "User Preferences" window seems to read the entire script library on every GHOST event happening in that panel. Just moving the mouse from one element to another, e.g. mouse over background -> mouse over search panel, triggers blender to reread all scripts. I tested this with ProcessMonitor and the attached config. This behavior is especially bad with blender installed on a global network drive. - Steps for others to reproduce the error (preferably based on attached .blend file) --- - open ProcessMonitor (http://technet.microsoft.com/en-us/sysinternals/bb896645) and import the attached configuration - open blender - open the addons panel in the user preferences window - move your mouse over different elements (search field, category filter fields ...) - observe a full script library re-read at every focus change %%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%also confirmed in Ubuntu with: strace -e trace=file blender%%%

%%%also confirmed in Ubuntu with: strace -e trace=file blender%%%
Member

%%%Confirmed. The userpref Addons panel runs the addon_utils.modules() function on every draw (space_userpref.py, USERPREF_PT_addons.draw, line 1145). The actual module loading happens only once (unless file times changed), but it still has to call os.listdir to test all the file names, paths and dates (in bpy.path.module_names()).

It seems to me this happens by design to make sure the modules list always reflects actual files. Caching these file lists properly would require some way of detecting file system events and set a dirty flag at least, not sure if that is feasible.

Campbell: What do you think? Any nice way to avoid slow file access on the user side?%%%

%%%Confirmed. The userpref Addons panel runs the addon_utils.modules() function on every draw (space_userpref.py, USERPREF_PT_addons.draw, line 1145). The actual module loading happens only once (unless file times changed), but it still has to call os.listdir to test all the file names, paths and dates (in bpy.path.module_names()). It seems to me this happens by design to make sure the modules list always reflects actual files. Caching these file lists properly would require some way of detecting file system events and set a dirty flag at least, not sure if that is feasible. Campbell: What do you think? Any nice way to avoid slow file access on the user side?%%%

%%%Seems related to this report:
https://projects.blender.org/tracker/index.php?func=detail&aid=35961&group_id=9&atid=498

I couldn't exactly redo that issue but if it's doing file access on every draw, then it makes sense, because I have an SSD drive where you probably wouldn't notice it much.%%%

%%%Seems related to this report: https://projects.blender.org/tracker/index.php?func=detail&aid=35961&group_id=9&atid=498 I couldn't exactly redo that issue but if it's doing file access on every draw, then it makes sense, because I have an SSD drive where you probably wouldn't notice it much.%%%

%%%Thanks Lukas and Brecht for looking into this issue.

It seem to me that an update on every event in that panel is a little bit overkill. We have blender installed on a global network share to ensure that all machines on the network have the same version available when updating. That works pretty well except with this issue. When the panel is open, blender freezes for 2-3 seconds every time an update event happens - and you can barely move your mouse there without triggering some kind of event. :)

Couldn't that list only be loaded once when opening the user preferences window or after switching to the addons panel or maybe with a Reload/Refresh button? How often are addons expected to change and is it really necessary to constantly check?

The report linked by Brecht is exactly what we are experiencing, except it is not a regression from 2.67 on our side. As far as I can remember, this issue exists since the beginning of the addon system.%%%

%%%Thanks Lukas and Brecht for looking into this issue. It seem to me that an update on every event in that panel is a little bit overkill. We have blender installed on a global network share to ensure that all machines on the network have the same version available when updating. That works pretty well except with this issue. When the panel is open, blender freezes for 2-3 seconds every time an update event happens - and you can barely move your mouse there without triggering some kind of event. :) Couldn't that list only be loaded once when opening the user preferences window or after switching to the addons panel or maybe with a Reload/Refresh button? How often are addons expected to change and is it really necessary to constantly check? The report linked by Brecht is exactly what we are experiencing, except it is not a regression from 2.67 on our side. As far as I can remember, this issue exists since the beginning of the addon system.%%%

%%%Regarding filesystem reads, I knew when writing this that reading on draw could be an issue, but even on a non-ssd this goes fast for me (I expect the OS cache kicks in).

Note that its not actually reading the data on draw, just getting a list of files in a directory, the module info is read and cached.

Of for whatever reason its reading from the physical disk on every draw - that will be a problem of course.%%%

%%%Regarding filesystem reads, I knew when writing this that reading on draw could be an issue, but even on a non-ssd this goes fast for me (I expect the OS cache kicks in). Note that its not actually reading the data on draw, just getting a list of files in a directory, the module info is read and cached. Of for whatever reason its reading from the physical disk on every draw - that will be a problem of course.%%%

%%%Here's my method of producing the error, is quite alternative.

  1. Hold Shift and drag the corner of the 3D Viewport EditorType to bring a floating window and minimize it (it won't be needed anymore, do not close it).
  2. Now when in the other application window, go to the Outliner EditorType window and split it downwards.
  3. Now try to revert it back to normal, merge the two Outliner windows.
  4. Crash is generated.
    %%%
%%%Here's my method of producing the error, is quite alternative. 1. Hold Shift and drag the corner of the 3D Viewport EditorType to bring a floating window and minimize it (it won't be needed anymore, do not close it). 2. Now when in the other application window, go to the Outliner EditorType window and split it downwards. 3. Now try to revert it back to normal, merge the two Outliner windows. 4. Crash is generated. %%%

%%%const, I think you accidentally replied to the wrong bug report?%%%

%%%const, I think you accidentally replied to the wrong bug report?%%%

%%%I'd like to add that I've also had trouble running Blender from a network drive due to the fact that the addons preferences window grinds to a halt. This is even on a very, very fast local network. I've had this experience since starting at my school two years ago. It gets worse the more addons you have in the install directory.

Win7 Pro x64, probably remotely accessing Win Server 2008 R2, but I'm not positive. I don't have access to all of that, just my home folder.%%%

%%%I'd like to add that I've also had trouble running Blender from a network drive due to the fact that the addons preferences window grinds to a halt. This is even on a very, very fast local network. I've had this experience since starting at my school two years ago. It gets worse the more addons you have in the install directory. Win7 Pro x64, probably remotely accessing Win Server 2008 R2, but I'm not positive. I don't have access to all of that, just my home folder.%%%
Member

%%%@Campbell, Brecht: Would it be acceptable to cache the addon files list once, e.g. when opening userprefs or even just when starting Blender? The userprefs ui could get an explicit refresh button, or the addon list could just be reloaded along with F8 script reload (not sure if that makes sense). The file space works this way after all ...%%%

%%%@Campbell, Brecht: Would it be acceptable to cache the addon files list once, e.g. when opening userprefs or even just when starting Blender? The userprefs ui could get an explicit refresh button, or the addon list could just be reloaded along with F8 script reload (not sure if that makes sense). The file space works this way after all ...%%%

%%%@Lukas-132 Toenne, caching the file list needs to be done with care - since you can install addons once blender is loaded... change the user preferences for the script path.

Its also possible to load blender, then restore factory settings from a previous install - which would change the addon paths...

So... best to do,

  • cache paths as suggested.
  • add an addon-rescan button
  • add a function addon_utils.modules_rescan(), for eg.
  • make sure the function is called after installing a new addon... changing user script path, etc.%%%
%%%@Lukas-132 Toenne, caching the file list needs to be done with care - since you can install addons once blender is loaded... change the user preferences for the script path. Its also possible to load blender, then restore factory settings from a previous install - which would change the addon paths... So... best to do, - cache paths as suggested. - add an addon-rescan button - add a function addon_utils.modules_rescan(), for eg. - make sure the function is called after installing a new addon... changing user script path, etc.%%%

%%%eh, make that restore FACTORY settings --> restore settings%%%

%%%eh, make that `restore FACTORY settings` --> `restore settings`%%%
Member

%%%On my system the addon viewer in User Prefs is responsive. I can imagine it's not very fast for everyone, but things work 'as meant to' , how the buttons in blender work anyway.

I suggest to mark this as a todo in wiki for later investigation? Especially if a proper fix isn't trivial or about to happen soon.%%%

%%%On my system the addon viewer in User Prefs is responsive. I can imagine it's not very fast for everyone, but things work 'as meant to' , how the buttons in blender work anyway. I suggest to mark this as a todo in wiki for later investigation? Especially if a proper fix isn't trivial or about to happen soon.%%%

%%%@Ton, issue is that filesystem list isnt always cached (network drives), blender should be usable on a network drive.

Since this isnt a regression its not so bad but Ill try find time to check on this next week.%%%

%%%@Ton, issue is that filesystem list isnt always cached (network drives), blender _should_ be usable on a network drive. Since this isnt a regression its not so bad but Ill try find time to check on this next week.%%%
Member

%%%I've added a patch as suggested:
https://codereview.appspot.com/13271043/

There may be missing cases where the "scan_addons" flag should be set in the RNA. Also not sure if UserPrefs is the right place for that flag, but seems to be the most intuitive solution.%%%

%%%I've added a patch as suggested: https://codereview.appspot.com/13271043/ There may be missing cases where the "scan_addons" flag should be set in the RNA. Also not sure if UserPrefs is the right place for that flag, but seems to be the most intuitive solution.%%%
Member

%%%Your reported issue has been fixed in SVN. Thanks for taking the
time to report!.%%%

%%%Your reported issue has been fixed in SVN. Thanks for taking the time to report!.%%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#36387
No description provided.