Page MenuHome

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

Description

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.

Event Timeline

Evan Wilson (EAW) changed the task status from Needs Triage to Needs Information from User.Sat, Feb 8, 9:22 PM

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?

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.

Evan Wilson (EAW) changed the task status from Needs Information from User to Confirmed.Mon, Feb 10, 4:30 PM

Before bisecting, I can confirm that 2.81a release doesn't have this issue, and 2.83 rBf8df6286c2c0 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...

Confirmed to be caused by 0a95a0852eb1 @Clément Foucault (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 Sharybin (sergey)?

Evan Wilson (EAW) renamed this task 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..Mon, Feb 10, 11:33 PM
Evan Wilson (EAW) renamed this task 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..Mon, Feb 10, 11:43 PM
Evan Wilson (EAW) triaged this task as High priority.
Evan Wilson (EAW) updated the task description. (Show Details)
Evan Wilson (EAW) edited projects, added BF Blender (2.82); removed BF Blender.
Sergey Sharybin (sergey) raised the priority of this task from High to Unbreak Now!.