Outliner performance with many objects kills Blender
Open, ConfirmedPublic


System Information
Win10 x64 1703, nVidia GTX 780 3GB, latest drivers

Blender Version
Broken: all
Worked: (optional)

Short description of error
I noticed that Blender becomes totally unresponsive (you will have to kill it in the task manager) if you add lots of objects to a scene and there's an Outliner in your layout showing either the scene(s) or groups. In my case it started when I imported a scene with over 32.000 objects all sharing the same mesh data. I attached this scene here.
As long as you don't have any Outliner open or it's set to e.g. show "Orphan Data" Blender handles all these objects like a pro. Cycles starts rendering within seconds, the viewport is responsive at least as long as it's set to "Bounding Box" with my old graphics card. It's only the Outliner that causes the problem.

Exact steps for others to reproduce the error

  • Load the attached blend file. This will take a while. Make sure you choose to a) "Load UI" or b) load it with a layout without any Outliner open otherwise you can most likely kill Blender because it won't react any more.
  • If you loaded the UI just switch the Outliner from "Orphan Data" to "Current Scene".
  • If you opened the blend file with your own layout without any Outliner just add an Outliner and make sure it's set to e.g. "Current Scene".
  • Watch the blue wheel spinning or whatever your OS does when a task is unresponsive.
  • Grab a coffee... wait... drink a beer... wait... sleep... wait... wake up again and kill Blender ;)



So it's not a crash or anything, but at least on my computer, if I don't interact with the outliner, it will eventually (within minutes) become responsive again (on master). I'm working on getting a profile now.

Seems most of the time is being spent in outliner_make_hierarchy, representing something like 22% of the execution time (this includes also the time it took to load the blend file...).

So it seems the outliner always does (what seems to be) a relatively expensive tree building exercise every time it decides it needs to draw. Maybe caching or some smarts could help, I'll play around with it.

Thanks Corey for having a look at this. I hope you find something to improve this as it's a major bottleneck here right now.

I don't know if this helps in any way but if I enable the new dependency graph (--enable-new-depsgraph) the scene load time goes from several minutes to a mere 5 seconds.
The Outliner performance problems persist though.

If you want to test the Outliner draw performance the easy way is to open an relatively small image in UV editor and go to Data-blocks > Images - find the image > Pixels. All the pixels values are drawn there. So if the image has 1000000 pixels there will be millions of entries. That will also consume a lot of ram, and possibly lock up blender too.

Thanks for your answer, Vuk. I didn't even know that one could find every single pixel of an image in the Outliner... crazy ;)

I just tried a tiny image (256x256=65.536 pixels) and Blender / Outliner was completely unimpressed.

Then I became too brave and tried a full HD image (1920x1080 = 2.073.600 pixels) and that gave the Outliner something to think about. The memory spiked several times (not very high though) and I could eventually close the Outliner.
But that's over 2 millions of entries and sliders and I can kind of "understand" that Blender is having a hard time dealing with this. And although this scenario is kind of synthetic, it would still be much better if the Outliner would only update or refresh the data you're currently looking at, i.e. the 40 pixel values you're currently able to see in the Outliner, not all 2 millions...

And in my case it was only ~32.000 objects, all sharing the same mesh data and material. And all other aspects of Blender dealt with it buttery smooth. Only the Outliner ruined the job.

matali23 (matali23) triaged this task as "Confirmed" priority.Wed, Jun 28, 9:23 AM

I can confirm that it's fast with the new depsgraph. Even with outliner opened. Scrolling with mouse well in the outliner works smoothly even. But dragging the scrollbar to go quickly to another position in the outliner will hang blender...

Maybe a good workaround in the meantime would be to not update the UI or once per second while dragging the scrollbar.