rB0a95a0852eb1 tags all objects in a scene for depsgraph update when leaving edit mode, causing significant lag. #73675

Closed
opened 2020-02-08 13:19:04 +01:00 by dev369 · 11 comments

Blender Version
Broken: 0a95a0852e

Short description of error

Switching from edit mode back to object mode has significant lag (2-7 seconds) every time compared to 0.1-0.5 before.

The more objects in a scene, the more lag that occurs. This is because all objects in a scene are now tagged to be updated in depsgraph when leaving edit mode.

Setting this as high as it is a recent fix that is in the 2.82 release build.

Exact steps for others to reproduce the error

  1. Created a scene with 1000 objects.
  2. Select one.
  3. Tab into edit mode.
  4. Tab out of edit mode.
**Blender Version** Broken: 0a95a0852eb1 **Short description of error** Switching from edit mode back to object mode has significant lag (2-7 seconds) every time compared to 0.1-0.5 before. The more objects in a scene, the more lag that occurs. This is because all objects in a scene are now tagged to be updated in depsgraph when leaving edit mode. Setting this as high as it is a recent fix that is in the 2.82 release build. **Exact steps for others to reproduce the error** 1. Created a scene with 1000 objects. 2. Select one. 3. Tab into edit mode. 4. Tab out of edit mode.
Author

Added subscriber: @dev369

Added subscriber: @dev369
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Thank you for the report. Do you have a simplified .blend file to upload that shows the issue? Are you editing multiple objects at a time? Do any of the objects share mesh data? If so are any of the objects hidden?

Thank you for the report. Do you have a simplified .blend file to upload that shows the issue? Are you editing multiple objects at a time? Do any of the objects share mesh data? If so are any of the objects hidden?
Author

The amount of performance degradation is directly proportional to amount of geometry/objects in the scene. More objects/geometry there is, more performance degradation. It has nothing to do with amount of geometry in single object but amount of geometry in entire scene, so even if you select a low poly object and start switching from edit to object performance will still degrade. Here is a simple way to replicate the issue:

download the test scene https://download.blender.org/demo/eevee/race_spaceship/race_spaceship.blend and duplicate the Ship collection about 50 times, then select any object and start switching between edit and object mode. In version 092deb88b0 you should experience consistent lag and in versions before that one you will experience little lag first time you switch and after that you should not experience it anymore or very little compared to the consistent lag in other version.

The amount of performance degradation is directly proportional to amount of geometry/objects in the scene. More objects/geometry there is, more performance degradation. It has nothing to do with amount of geometry in single object but amount of geometry in entire scene, so even if you select a low poly object and start switching from edit to object performance will still degrade. Here is a simple way to replicate the issue: download the test scene https://download.blender.org/demo/eevee/race_spaceship/race_spaceship.blend and duplicate the Ship collection about 50 times, then select any object and start switching between edit and object mode. In version 092deb88b074 you should experience consistent lag and in versions before that one you will experience little lag first time you switch and after that you should not experience it anymore or very little compared to the consistent lag in other version.
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

Before bisecting, I can confirm that 2.81a release doesn't have this issue, and 2.83 f8df6286c2 does.

I copied the Ship Collection 30 times. Selected an object, and hit tab to go into edit mode.
Hitting tab to go back into object mode results in a lock up as the following occurs:

graph_id_tag_update: id=OBCube.001 flags=TRANSFORM, GEOMETRY source=USER_EDIT
graph_id_tag_update: id=OBCube.001 flags=TRANSFORM, GEOMETRY source=USER_EDIT
graph_id_tag_update: id=MECube.000 flags=LEGACY_0 source=USER_EDIT```

do that 650 times

[SCScene :: Ship]: Operation is entry point for update: TRANSFORM_SIMULATION_INIT()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_ENTRY()
[SCScene :: Ship]: Operation is entry point for update: TRANSFORM_FINAL()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL()
[SCScene :: Ship]: Operation is entry point for update: TRANSFORM_LOCAL()
[SCScene :: Ship]: Operation is entry point for update: TRANSFORM_PARENT()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: Ship]: Operation is entry point for update: TRANSFORM_SIMULATION_INIT()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EXIT()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: Ship]: Operation is entry point for update: COPY_ON_WRITE()
ect, ect...


You get the idea

[SCScene :: Ship]: Accumulated recalc bits for OBCube.001: 8323
[SCScene :: Ship]: Accumulated recalc bits for MECube.000: 4282380163


650 times

[SCScene :: Ship]: deg_evaluate_copy_on_write on MECube.083 (000001AF23AC2438)
[SCScene :: Ship]: deg_evaluate_copy_on_write on OBCube.083 (000001AF1391B5C8)

650 times


```[SCScene :: Ship]: BKE_object_data_select_update on MEMesh.039 (000001AF23AC2AC8)
[SCScene :: Ship]: BKE_mesh_eval_geometry on MEMesh.039 (000001AF23AC2AC8)```

650 times

```Depsgraph updated in 6.984932 seconds.
Depsgraph evaluation FPS: 0.006883```

I am guessing that 0a95a0852eb1 is the cause.

Bisecting...
Before bisecting, I can confirm that 2.81a release doesn't have this issue, and 2.83 f8df6286c2 does. I copied the Ship Collection 30 times. Selected an object, and hit tab to go into edit mode. Hitting tab to go back into object mode results in a lock up as the following occurs: ``` graph_id_tag_update: id=OBCube.001 flags=TRANSFORM, GEOMETRY source=USER_EDIT graph_id_tag_update: id=OBCube.001 flags=TRANSFORM, GEOMETRY source=USER_EDIT graph_id_tag_update: id=MECube.000 flags=LEGACY_0 source=USER_EDIT``` do that 650 times ``` [SCScene :: Ship]: Operation is entry point for update: TRANSFORM_SIMULATION_INIT() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_ENTRY() [SCScene :: Ship]: Operation is entry point for update: TRANSFORM_FINAL() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL() [SCScene :: Ship]: Operation is entry point for update: TRANSFORM_LOCAL() [SCScene :: Ship]: Operation is entry point for update: TRANSFORM_PARENT() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: Ship]: Operation is entry point for update: TRANSFORM_SIMULATION_INIT() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EXIT() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: Ship]: Operation is entry point for update: COPY_ON_WRITE() ect, ect... ``` You get the idea ``` [SCScene :: Ship]: Accumulated recalc bits for OBCube.001: 8323 [SCScene :: Ship]: Accumulated recalc bits for MECube.000: 4282380163 ``` 650 times ``` [SCScene :: Ship]: deg_evaluate_copy_on_write on MECube.083 (000001AF23AC2438) [SCScene :: Ship]: deg_evaluate_copy_on_write on OBCube.083 (000001AF1391B5C8) ``` 650 times ```[SCScene :: Ship]: BKE_object_data_select_update on MEMesh.039 (000001AF23AC2AC8) [SCScene :: Ship]: BKE_mesh_eval_geometry on MEMesh.039 (000001AF23AC2AC8)``` 650 times ```Depsgraph updated in 6.984932 seconds. Depsgraph evaluation FPS: 0.006883``` I am guessing that 0a95a0852eb1 is the cause. Bisecting...
Member

Added subscribers: @fclem, @Sergey

Added subscribers: @fclem, @Sergey
Member

Confirmed to be caused by 0a95a0852e @fclem

Previously, tabbing out of edit mode with only one object resulted in only that one object being updated in the depsgraph.

graph_id_tag_update: id=OBCube.000 flags=GEOMETRY source=USER_EDIT
graph_id_tag_update: id=OBCube.000 flags=GEOMETRY source=USER_EDIT
graph_id_tag_update: id=MECube.034 flags=LEGACY_0 source=USER_EDIT
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EXIT()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_SELECT_UPDATE()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: Ship]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL_DONE()
[SCScene :: Ship]: Operation is entry point for update: PARAMETERS_ENTRY()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: Ship]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL_INIT()
[SCScene :: Ship]: Accumulated recalc bits for OBCube.000: 8322
[SCScene :: Ship]: Accumulated recalc bits for MECube.034: 4282380163
[SCScene :: Ship]: deg_evaluate_copy_on_write on MECube.034 (000002107AD95EA8)
[SCScene :: Ship]: deg_evaluate_copy_on_write on OBCube.000 (000002105C0CD318)
[SCScene :: Ship]: BKE_object_data_select_update on MECube.034 (000002107AD95EA8)
[SCScene :: Ship]: BKE_mesh_eval_geometry on MECube.034 (000002107AD95EA8)
[SCScene :: Ship]: BKE_object_eval_uber_data on OBCube.000 (000002105C0CD318)
[SCScene :: Ship]: BKE_object_handle_data_update on OBCube.000 (000002105C0CD318)
[SCScene :: Ship]: BKE_object_select_update on OBCube.000 (000002105C0CD318)
[SCScene :: Ship]: BKE_object_data_select_update on MECube.034 (000002107AD95EA8)
Depsgraph updated in 0.008775 seconds.```

Now everything is tagged to be updated.  

I know this was to fix the crashes and destroyed custom data layers in T69834, but is there another possible fix that doesn't have this trade off?  Any ideas @sergey?
Confirmed to be caused by 0a95a0852eb1 @fclem Previously, tabbing out of edit mode with only one object resulted in only that one object being updated in the depsgraph. ``` graph_id_tag_update: id=OBCube.000 flags=GEOMETRY source=USER_EDIT graph_id_tag_update: id=OBCube.000 flags=GEOMETRY source=USER_EDIT graph_id_tag_update: id=MECube.034 flags=LEGACY_0 source=USER_EDIT [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EXIT() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_EVAL() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_SELECT_UPDATE() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: Ship]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL_DONE() [SCScene :: Ship]: Operation is entry point for update: PARAMETERS_ENTRY() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: Ship]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: Ship]: Operation is entry point for update: GEOMETRY_EVAL_INIT() [SCScene :: Ship]: Accumulated recalc bits for OBCube.000: 8322 [SCScene :: Ship]: Accumulated recalc bits for MECube.034: 4282380163 [SCScene :: Ship]: deg_evaluate_copy_on_write on MECube.034 (000002107AD95EA8) [SCScene :: Ship]: deg_evaluate_copy_on_write on OBCube.000 (000002105C0CD318) [SCScene :: Ship]: BKE_object_data_select_update on MECube.034 (000002107AD95EA8) [SCScene :: Ship]: BKE_mesh_eval_geometry on MECube.034 (000002107AD95EA8) [SCScene :: Ship]: BKE_object_eval_uber_data on OBCube.000 (000002105C0CD318) [SCScene :: Ship]: BKE_object_handle_data_update on OBCube.000 (000002105C0CD318) [SCScene :: Ship]: BKE_object_select_update on OBCube.000 (000002105C0CD318) [SCScene :: Ship]: BKE_object_data_select_update on MECube.034 (000002107AD95EA8) Depsgraph updated in 0.008775 seconds.``` Now everything is tagged to be updated. I know this was to fix the crashes and destroyed custom data layers in T69834, but is there another possible fix that doesn't have this trade off? Any ideas @sergey?
Evan Wilson changed title from Performance degradation changing from edit mode to object mode to rB0a95a0852eb1 tags all objects in a scene for depsgraph update when leaving edit mode. 2020-02-10 23:33:58 +01:00
Evan Wilson changed title from rB0a95a0852eb1 tags all objects in a scene for depsgraph update when leaving edit mode. to rB0a95a0852eb1 tags all objects in a scene for depsgraph update when leaving edit mode, causing significant lag. 2020-02-10 23:43:22 +01:00
Sergey Sharybin self-assigned this 2020-02-11 10:09:33 +01:00

This issue was referenced by 3dcddf83bf

This issue was referenced by 3dcddf83bfd48a47716de10626c19ef3ce48d021

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.82 milestone 2023-02-08 16:41:32 +01:00
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
4 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#73675
No description provided.