Page MenuHome

eevee/blender freezing for a few seconds when renaming a few materials via python
Closed, ResolvedPublic

Description

System Information
Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67

Blender Version
Broken: version: 2.81 (sub 15), branch: master, commit date: 2019-10-24 19:00, hash: rB892c3891ed0b

Short description of error
In the attached blend, I have a few objects and materials. In the script in the text editor I'm batch renaming the materials.
Whenever I call this script and the 3d view is in lookdev or eevee rendered shading, I'm seeing blender freezing for a few seconds, AFTER the renaming concluded.
I'm not chaning any material parameters. There's is no indication that the shaders are recompiling. It's just the material names that changed.
I am using bump nodes in some of the materials, so it may be again related to this previous issue I've submitted recently.
Removing all node groups using the bump node, leads to no more freezing.

Renaming node trees in a similar fashion, will also cause the freeze however, even if only node tree's that don't contain a bump node are renamed.

video demo

Exact steps for others to reproduce the error

  • open the blend file in 2.81
  • in with eevee shading, run the script, notice how the terminal says renaming is finished
    • immedately try rotatiing he viewport, notice how Blender is unresponsive for a few seconds
  • repeat in solid or rendered cyclices shading
    • notice how there's no freeze

Event Timeline

MACHIN3 (MACHIN3) updated the task description. (Show Details)

Yeah, exactly the same behavior on Windows

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-13 08:24, hash: rBc73a99ef902b

Also confirming identical behavior...

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.70

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-08 22:59, hash: rB0a0d735acd6e

The same bahavior

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.20

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-13 16:25, hash: rB9bd0d8b5505a

Philipp Oeser (lichtwerk) closed this task as Archived.Jan 15 2020, 6:47 PM
Philipp Oeser (lichtwerk) claimed this task.

I can confirm the slowdown, this is where the time is spent:

This was introduced in rBffd5e1e6acd2: Eevee: Use manual derivatives for better quality bump. and as you can see, it copies a branch in the tree to get the "derivatives" [which involves copying nodes and thus a call to BLI_uniquename]
I think this is known to be slow, @Bastien Montagne (mont29), not sure if rB2aab72700909: ID Management: Improve speed of code used when creating/renaming and ID. & rB46607bc09d5c: ID Management: Improve speed of code used when creating/renaming and ID. affected this in any way (probably not)?

If @Clément Foucault (fclem) doesnt have something magic under his sleeve, I guess this is not a bug though and more of a performance issue that might or might not vanish at some point.

I think if there is no obvious flaw in implementation, we should close performance issues as not-a-bug?

@Philipp Oeser (lichtwerk) those commits only affect ID names management, which uses its own code, not BLI_uniquename(). And nodes are not IDs…

Philipp Oeser (lichtwerk) changed the task status from Archived to Resolved.Jan 26 2020, 7:13 PM

@Bastien Montagne (mont29): thx for clarification.

Also note that rB32f0bb052308: Fix T70766 EEVEE: Performance drop with node tree in 2.81 also solved this issue reported here (along with T70766)