Node Editor gets unusably slow in scenes of average production complexity #98574
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
18 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#98574
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.59
Blender Version
Broken: version: 3.1.2, branch: SelectThrough, commit date: 2022-04-27 08:19, hash:
a3ae0cf3a7
Worked: Probably never
Short description of error
The node editor, as well as other parts of Blender get unusably slow when the scene complexity reaches level of average production scenes from about 5-10 years ago (About 30 million triangles on average). This even includes the operations, which should not require re-evaluation of the entire complex scene dependencies, such as moving unconnected nodes in the shader editor.
Exact steps for others to reproduce the error
SlowScene_Base.blend
Result: The constant UI blocking freezes make it impossible to work with the node editor when scene complexity exceeds trivial level.
Expected: The performance of the node editor remains acceptable in the scenes of production complexity.
Note: Feel free to duplicate the objects in the viewport to increase the severity of the lags and freezes.
Bit of research: this is because of UNDO.
If you turn OFF
Global Undo
in the Preferences (or setUndo Steps
to zero) everything is back to being snappy fast.Not sure if this can be smarter, but this does make sense in a way because Global Undo keeps a copy of the whole file in memory?
Added subscriber: @Rawalanche
#99299 was marked as duplicate of this issue
Added subscriber: @OmarEmaraDev
Changed status from 'Needs Triage' to: 'Needs User Info'
The computations seems to be spent just redrawing the viewport, can you confirm this by closing the 3D view editor and see if it is still slow?
That makes no sense. The viewport navigation runs at 60+ FPS, so the drawing of the viewport does not take anywhere near as long. The delay between for example click-dragging the node to move it and actual move operation starting is far longer than 16 milliseconds.
And yes, it also happens when I close the viewport. I am quite confused, as I've provided a repro scene, so you could have tested it yourself. I see no reason it should behave differently on your system than mine.
How did you arrive at a conclusion that the computation is spent just redrawing the scene? Have you actually opened the file and followed the repro steps?
I did open the file and tested your reproduction case, but I couldn't replicate the freezing. The only thing I experienced was some stuttering due to redraws, which doesn't happen if I close the 3D view, hence my inquiry.
Perhaps you can attach a small video that demonstrates the issue?
2022-06-06 14-04-04.mp4
Changed status from 'Needs User Info' to: 'Needs Triage'
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs User Info'
Hm, also no drastic slowdowns on my side (7 year old laptop!)
This is 3.2.0 RC in factory settings:
It's most prominent when click-dragging not yet selected nodes in the shader editor to move them.2022-06-07 14-25-16.mp4
You will not manage to repro it if you don't apply the visual geometry to mesh. The important part is to have many high poly meshes in the scene. Not just low poly meshes which generate high polycount through dynamic modifiers. The reason I included the scene with additional steps is that if I uploaded the geometry collapsed to polygons, the file would be giant.
It's so bad that the click-drag gesture often even doesn't register.
Added subscriber: @tomjk
Can reproduce on just-released blender 3.2 with load factory defaults: click-dragging selected nodes has a slight pause at drag end, and for unselected nodes an additional slightly longer pause at drag start. By eye, maybe ~100ms and ~150ms respectively. Similar delay at start and end when click-dragging an empty selection box.
This remains true after removing all other editors; also with no objects selected and editing world shader nodes; and after deleting all objects. If I then purge the orphan mesh datablocks, the pauses go away.
system:
linux mint 20
i7-6700K
RTX 2060 SUPER [driver 510.47.03; a little outdated, latest being 510.73.05]
Changed status from 'Needs User Info' to: 'Needs Triage'
Added subscribers: @Olliver, @mano-wii, @iss
Added subscriber: @PratikPB2123
Changed status from 'Needs Triage' to: 'Confirmed'
Can notice significant slowdown in node operations after
Visual Geometry to Mesh
operationCome on, seriously? "consider using less complex geometry"
30M polygons was average for a production scene 10 years ago. This is really not acceptable. This is also not a general performance issue, as in not every part of Blender slows down evenly. This is just one subset of operations in a specific editor. By these standards, how come this one was considered a bug and solved? https://developer.blender.org/T94609 It's the exact same class of issue. Something was triggering complete scene recalculation when it was not supposed to.
Added subscriber: @silex
Unfortunately I must confirm this. I'm not working on 'production' size scenes, yet with more complicated ones I find that I pause Cycles viewport, tweak some shader parameters and unpause the viewport to see the changes. It's not very efficient way of work,
Scene from the report gives me very noticeable lag when moving nodes, or adjusting their parameters after duplicating objects 4 times (without applying visual geometry to mesh). With applying modifiers I have lag just after one duplication.
Also a note - I had similar issues in scenes with much less polycount than 30 mil - just around 2,5 mil faces (~5 mil tris).
CPU - Threadripper 3970X
3.3 is almost released and this is still ignored. This is not a general performance insufficiency. This is a bug which causes whole scene to re-evaluate when nodes are selected and moved around. A change, which should not even need to read, let alone re-evaluate mesh geometry in the viewport does so.
Let me add that I can reproduce this now (not sure why that was not the case previously).
Added subscribers: @JacquesLucke, @mont29
Looked at this a bit and this is because of UNDO.
If you turn OFF
Global Undo
in the Preferences (or setUndo Steps
to zero) everything is back to being snappy fast.Not sure if this can be smarter, but this does make sense in a way because Global Undo keeps a copy of the whole file in memory?
@mont29 or @JacquesLucke might know more...
Don't know too much about undo and possible mitigation strategies, but it feels like #95845 could solve this long term if we go "all in".
I see. That explains why this slowness affects more parts of Blender, and this being only one of many manifestations of this. Not sure how to solve this, but it's certainly not good, since complexity of this scenes is nothing out of ordinary these days.
Also, I am a bit confused about what does the "global undo" toggle do? It seems to turn off undo altogether. When I uncheck global undo, undo action stops working completely, so that's definitely not a feasible workaround. If it's called "global undo", then once unchecked, what does the "local undo" do? In which scope the undo works then, because it's certainly not 3D view or the node editor.
It's really crazy to think that every move of any node in the node editor will duplicate all 30 million triangles worth of meshes in the memory every time I do that.
Added subscriber: @geocentric_wage
Added subscriber: @AlexeyAdamitsky
Added subscriber: @HooglyBoogly
@HooglyBoogly are you planing to work on this issue, to tag it as high priority?
@JacquesLucke @lichtwerk would be interesting to do a profiling here, the 'undo system' is a very vague and wide area that can be affected by a lot of 'unrelated' code in Blender.
@Rawalanche Blender certainly does not write 30M triangles every time you move a node, otherwise you would run out of RAM in a few undo steps. But it does 'fake-write' the whole .blend file to be able to generate its memory diff, and only effectively keep in memory the differences from the previous step.
Again, without proper profiling, it's impossible to go further.
Added subscriber: @deadpin
I did a quick profile below. This won't lead to a solution directly but hopefully it'll kickstart the process.
Most of the time is spent inside
BLO_memfile_chunk_add
. In the provided scene, making any viewport selection, or shader node movement, results in the following:memcmp
Yeah, that's also what I found, almost all time is spent in
memcmp
. It could probably be speedup a bit with parallelization, but the bottleneck will likely remain the same. The benefit of #95845 is that thismemcmp
would just not be necessary. To store an array for undo, one would just have to increase a reference count.Thanks. There is really no reason to set this to high then, this is simply 'known issue' due to how code works currently. Not saying it should not be improved obviously.
@JacquesLucke not really sure how #95845 could be applied to our mem undo, not without a complete rewrite of the whole system at least...
Also, here on a relatively recent machine under linux, I only start seeing a (barely) noticeable lag when over 100M triangles (duplicating all objects 4 times after apply geometry), this is an 8GB blend file... So would not call that a critical issue by any mean.
As a note, I did a quick check on making that memcmp part multi-threaded, while this looks possible it would actually imply duplicating all buffers memory (
memcpy
), since there is no guarantee those buffers are not generated just for filewrite purpose and therefore we can keep them around until threaded memcmp is processed... So that would end up being much worse.That shouldn't be a problem when the
memcmp
is just parallized "inplace"? I think what you tried is to postpone thememcmp
and do it outside of the scope ofBLO_memfile_chunk_add
.Well, it might require some rewriting, don't know too many details of the current undo system. This is also why I mentioned it as a possible long term goal.
That said, it doesn't feel extremely complicated. Here is an API addition that might work:
It would be used as follows:
I did not try if this actually works, but this is what I have in mind currently.
If it's platform specific, then it's still critical, as linux is negligible platform userbase-wise. I have quite high end machine, and the node editor becomes literally unusable just at about 30M triangles, which, as I wrote above, is just average production scene these days.
The point here is that the action to click and drag a node to move it will just straight up fail 3 out of 4 times. I don't think that can be dismissed as a known issue.
Here's an example with 60M triangles. The click-drag action has failed 9 out of 10 times. The one time it did not fail, it still failed to move the node to its final location:
2022-09-01 13-09-03.mp4
An issue where UI inputs simply stop working above certain scene complexity threshold, which is not uncommon, is serious, no matter how well known it is.
Any news on this? I have even nearly decade old production scenes which don't exceed any reasonable complexity, yet the node editor is unusable in them. For example:
A scene with mere 10M triangles and 600 objects should not be so slow that one can't use the node editor, even if the viewport is closed. This is not a limitation of current hardware or software architectures.
I'd understand if it was requested to have some state of the art performance optimization in Blender, but all that's requested is that the UI is usable with the scene complexity most of other software can handle easily with current day hardware.
Is there any chance this ever gets fixed? I am now in an embarrassing scenario where I have just a single 12M poly mesh in my scene, and I can't even shade it because the node editor isn't reliably responding to mouse inputs.
Added subscriber: @Nik-9
Added subscriber: @BD3D
Added subscriber: @EAW
Any news on this? I've updated to 3.4 and it's still not possible to work on scenes over 5M triangles without extremely laggy UI. Using Blender for not trivial lowpoly scenes is borderline impossible.
I tested the refactor I mentioned in my comment above (#98574#1411027) as part of D14139. It's working as expected. The changes to the undo system are fairly small.
The time to execute
BLO_write_file_mem
drops from150 ms
to0.4 ms
, which is only slightly slower than the startup .blend file. For the initial undo step, for which we currently need a full copy inmaster
, the improvement is from590 ms
to0.4 ms
.Thanks so much. Is there any estimate when this could end up in master?
Hey guys,
I am about to pull my hair out.
I have a scene less than 10 mil poly, and some objects with hair particles, but particles hidden in viewport, and it takes at least 30 seconds to add or move a node in the compositor.
Shader editor works fine.
Is this a separate issue?
I tried turning off global undo, but didn't seem to make any difference
@Sergiu-Hulpe #106903 is still in progress so this problem not fixed yet.
For updates, the page to follow is #106903. That will end up being part of 4.0, hopefully sooner rather than later.
I have a scene (~140MB) with less than 1 mil polycount and lots of Geometry Nodes instances that gives me the same lag as described in this ticket. I can send it if anyone is interested in checking it out.
Ludvik Koutny referenced this issue2023-11-14 13:54:17 +01:00