2.72 Freestyle renders two times longer on Linux #41964

Closed
opened 2014-09-26 13:29:12 +02:00 by Piotr Połomski · 47 comments

System Information
Debian 7.5
GPU: Nvidia GeForce 9800 GT
CPU: Intel Core 2 3GHz
RAM: 6GB RAM

Blender Version
Broken: Linux versions: 2.72 eb464ee (blender-2.72-RC1-linux-glibc211-x86_64) and previous testbuild (blender-2.72-testbuild1-linux-glibc211-x86_64)
Worked: 2.6; 2.7; 2.71, 2.72 windows 64 version

Short description of error
The problem is too long Freestyle Stroke rendering. Simple file with Ve: 19k, Fa: 22k is rendering about 14 seconds. It is long, but linux version 2.72 testbuild and RC1 doing the same two times longer, need about 27-30 seconds.

Exact steps for others to reproduce the error
Open file nut.blend and render in Linux and Windows versions.

**System Information** Debian 7.5 GPU: Nvidia GeForce 9800 GT CPU: Intel Core 2 3GHz RAM: 6GB RAM **Blender Version** Broken: Linux versions: 2.72 eb464ee (blender-2.72-RC1-linux-glibc211-x86_64) and previous testbuild (blender-2.72-testbuild1-linux-glibc211-x86_64) Worked: 2.6; 2.7; 2.71, 2.72 windows 64 version **Short description of error** The problem is too long Freestyle Stroke rendering. Simple file with Ve: 19k, Fa: 22k is rendering about 14 seconds. It is long, but linux version 2.72 testbuild and RC1 doing the same two times longer, need about 27-30 seconds. **Exact steps for others to reproduce the error** Open file [nut.blend](https://archive.blender.org/developer/F112753/nut.blend) and render in Linux and Windows versions.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @PiotrPL

Added subscriber: @PiotrPL
Tamito Kajiyama was assigned by Bastien Montagne 2014-09-26 13:49:17 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

Tamito, this one sounds for you. :)

Tamito, this one sounds for you. :)

Thanks Bastien. :)

Thanks Bastien. :)

Hello, I tested yesterday released 2.72 95182d1 (blender-2.72-linux-glibc211-x86_64.tar.bz2) and Freestyle Stroke rendering still takes two times longer than 2.71

Hello, I tested yesterday released 2.72 95182d1 (blender-2.72-linux-glibc211-x86_64.tar.bz2) and Freestyle Stroke rendering still takes two times longer than 2.71

I thought the report concerns a difference of rendering speeds between Linux and Windows. Do you mean that you have observed different rendering speeds between 2.71 and 2.72 both on Linux?

I thought the report concerns a difference of rendering speeds between Linux and Windows. Do you mean that you have observed different rendering speeds between 2.71 and 2.72 both on Linux?

Rendering about 14sec on versions:

Rendering two times longer on versions:

The same file, with the same rendering parameters.

Rendering about 14sec on versions: - Linux 2.66.5 r55841 - Linux 2.70a f93bc76 - Linux 2.71 a19c1be - Windows 64 2.72 eb464ee Rendering two times longer on versions: - Linux testbuild1 2.72 - Linux RC1 2.72 eb464ee - Linux 2.72 95182d1 The same file, with the same rendering parameters.
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Any news here? Getting quite old now.

Any news here? Getting quite old now.

Not much news from my side. I personally don't have a Linux box that can reproduce the reported speed problem. A friend of mine who uses Blender/Freestyle under Linux told me that he did not observe the issue.

@PiotrPL,
I suppose that you render the .blend file from within the Blender user interface. What happens if you render the file by one of the following ways?

  • render the file with the Display option set to Keep UI (instead of New Window, Image Editor, or Full Screen) and without the Image Editor not shown in the UI.
  • render the file by means of the command-line interface.
    This test will help us check if the slowness comes from Freestyle.
Not much news from my side. I personally don't have a Linux box that can reproduce the reported speed problem. A friend of mine who uses Blender/Freestyle under Linux told me that he did not observe the issue. @PiotrPL, I suppose that you render the .blend file from within the Blender user interface. What happens if you render the file by one of the following ways? * render the file with the Display option set to Keep UI (instead of New Window, Image Editor, or Full Screen) and without the Image Editor not shown in the UI. * render the file by means of the command-line interface. This test will help us check if the slowness comes from Freestyle.

Added subscriber: @zeauro

Added subscriber: @zeauro

I am under ubuntu 14.04 64bits.
The blend gives me these results :

2.71 : 10s 20
2.72b : 21s
2.72.3 hash 602250d : 12s

I am under ubuntu 14.04 64bits. The blend gives me these results : 2.71 : 10s 20 2.72b : 21s 2.72.3 hash 602250d : 12s
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Here are my stats compared to Ubuntu and windows

Untitled.png

Here are my stats compared to Ubuntu and windows ![Untitled.png](https://archive.blender.org/developer/F131515/Untitled.png)
Member

here is my specs

intel hd graphics 4600
blender 2.72b

here is my specs intel hd graphics 4600 blender 2.72b
Member

Could you guys test with all Add-Ons disabled? We had similar issues caused by Add-Ons.

Could you guys test with all Add-Ons disabled? We had similar issues caused by Add-Ons.
Member

Tested with Ubuntu and took twice as long with add-ons disabled about 1min 20 sec

Tested with Ubuntu and took twice as long with add-ons disabled about 1min 20 sec
Member

tested with 646a96b

tested with 646a96b

I cannot test on my workstation but on my laptop without addons.
2.71 20s
2.72b 52s
2.73fa0a 47s

I cannot test on my workstation but on my laptop without addons. 2.71 20s 2.72b 52s 2.73fa0a 47s
Member

Thanks, seems like Add-ons aren't the problem

Thanks, seems like Add-ons aren't the problem

Thank you all for the additional tests, very much appreciated!

If a few more test runs are acceptable, could you guys please do test renders with the --debug-freestyle command-line option specified when you start Blender? This will generate a lot of debug information on the console including the breakdown of Freestyle rendering time, which might allow us to identify the cause(s) of slow rendering on Linux. Please, consider saving the console output in a text file (e.g., by redirecting the standard output of Blender to a file as in ./blender --debug-freestyle > output.txt) and attaching the file to a reply. Thanks in advance.

Thank you all for the additional tests, very much appreciated! If a few more test runs are acceptable, could you guys please do test renders with the `--debug-freestyle` command-line option specified when you start Blender? This will generate a lot of debug information on the console including the breakdown of Freestyle rendering time, which might allow us to identify the cause(s) of slow rendering on Linux. Please, consider saving the console output in a text file (e.g., by redirecting the standard output of Blender to a file as in `./blender --debug-freestyle > output.txt`) and attaching the file to a reply. Thanks in advance.
[output271.txt](https://archive.blender.org/developer/F133400/output271.txt) [output272b.txt](https://archive.blender.org/developer/F133401/output272b.txt) [output273_0fcf9b2.txt](https://archive.blender.org/developer/F133402/output273_0fcf9b2.txt)

@zeauro Many thanks for the test results. Your logs allowed me to break down Freestyle time components. According to the analysis of timing information, there are no big differences in the Freestyle time components among Blender versions (see the comparisons in the attached PDF file). It looks like the slowness comes from somewhere outside the Freestyle rendering core.

20141224_zeauro_logs.pdf

Now I guess I have to look into the Blender rendering pipeline to identify the cause of the slowness...

@zeauro Many thanks for the test results. Your logs allowed me to break down Freestyle time components. According to the analysis of timing information, there are no big differences in the Freestyle time components among Blender versions (see the comparisons in the attached PDF file). It looks like the slowness comes from somewhere outside the Freestyle rendering core. [20141224_zeauro_logs.pdf](https://archive.blender.org/developer/F133406/20141224_zeauro_logs.pdf) Now I guess I have to look into the Blender rendering pipeline to identify the cause of the slowness...

Added subscribers: @kjym3, @JoshuaLeung, @ideasman42, @Sergey

Added subscribers: @kjym3, @JoshuaLeung, @ideasman42, @Sergey

@kjym3, the issue is barely visible with regular builds and totally visible when using jemalloc (probably because of different memory layout in that case or so).

The issue is introduced by 0464876 which in fact unleashes really evil aspect of freestyle. The thing here is, datablock data free would check if the datablock is used as a target of some driver (if it was used then driver's target ID would be set to NULL). Before the mentioned commit freestyle did not sent proper main to datablock free function, so iteration happened inside the wrong list. Now iteration happens with the proper list.

The cause of slowdown is the freestyle main free. It seems to contain around 13K datablocks, and assuming datablock deletion is O(n^2) that's gonna to take quite some time.

Hereby i'm raising some questions:

  • @kjym3, is it really necessary to create so much datablocks? Blender doesn't really handle such situations well.
  • @JoshuaLeung, @ideasman42 do we really need to iterate drivers when freeing the datablock data?
  • @kjym3, i guess the objects in freestyle main does not have any drivers animation, so in the worst case we can create extended version of datablock free function which we would tell not to iterate drivers?
@kjym3, the issue is barely visible with regular builds and totally visible when using jemalloc (probably because of different memory layout in that case or so). The issue is introduced by 0464876 which in fact unleashes really evil aspect of freestyle. The thing here is, datablock data free would check if the datablock is used as a target of some driver (if it was used then driver's target ID would be set to NULL). Before the mentioned commit freestyle did not sent proper main to datablock free function, so iteration happened inside the wrong list. Now iteration happens with the proper list. The cause of slowdown is the freestyle main free. It seems to contain around 13K datablocks, and assuming datablock deletion is O(n^2) that's gonna to take quite some time. Hereby i'm raising some questions: - @kjym3, is it really necessary to create so much datablocks? Blender doesn't really handle such situations well. - @JoshuaLeung, @ideasman42 do we really need to iterate drivers when freeing the datablock data? - @kjym3, i guess the objects in freestyle main does not have any drivers animation, so in the worst case we can create extended version of datablock free function which we would tell not to iterate drivers?
Member

@Sergey It is necessary to iterate through each driver when freeing it, because we need to free the DriverVariable instances (on the ChannelDriver), then the ChannelDriver (on the FCurve).

@Sergey It is necessary to iterate through each driver when freeing it, because we need to free the DriverVariable instances (on the ChannelDriver), then the ChannelDriver (on the FCurve).

@Sergey,

The issue of too many data blocks (mostly meshes) was one of problems I have addressed as part of my BF project (Apr-Sept 2014) for Freestyle performance optimization. A quick test on my side showed that when the performance optimization was applied, only one mesh data block was created for rendering the test scene rather than 13K data blocks. The actual number of auto-generated data blocks can still be arbitrarily large depending on input scenes, but is expected to be much smaller than non-optimized versions. Integrating the optimization coding results into Git master is a 2.74 target.

Freestyle does not use drivers at all.

@Sergey, The issue of too many data blocks (mostly meshes) was one of problems I have addressed as part of my BF project (Apr-Sept 2014) for Freestyle performance optimization. A quick test on my side showed that when the performance optimization was applied, only one mesh data block was created for rendering the test scene rather than 13K data blocks. The actual number of auto-generated data blocks can still be arbitrarily large depending on input scenes, but is expected to be much smaller than non-optimized versions. Integrating the optimization coding results into Git master is a 2.74 target. Freestyle does not use drivers at all.

@JoshuaLeung, i'm having hard time to understand why we need to do drivers on datablock free but don't need to do constraint/modifiers/parents etc at the same time actually.

@kjym3, that sounds good.

@JoshuaLeung, i'm having hard time to understand why we need to do drivers on datablock free but don't need to do constraint/modifiers/parents etc at the same time actually. @kjym3, that sounds good.

For those who compile Blender from source, here is a patch for the aforementioned Freestyle rendering optimization (rebased onto Git master, with a lot of conflicts addressed). The patch should apply cleanly to the latest HEAD as of this writing.

stroke_render_optimization.patch

Maybe it is too late to include this revision to the 2.73 release.

For those who compile Blender from source, here is a patch for the aforementioned Freestyle rendering optimization (rebased onto Git master, with a lot of conflicts addressed). The patch should apply cleanly to the latest HEAD as of this writing. [stroke_render_optimization.patch](https://archive.blender.org/developer/F133671/stroke_render_optimization.patch) Maybe it is too late to include this revision to the 2.73 release.

@kjym3, we can not accept this for 2.73, but master branch is open now so you can commit it for 2.74 when it's ready.

@kjym3, we can not accept this for 2.73, but master branch is open now so you can commit it for 2.74 when it's ready.

hello, I think I found solution, need to go to Freestyle Line Style, then in Strokes tab, check Chaining checkbox (and select Plain, check Same Object). Now nut.blend file renders for about 2 seconds! I hope it helps

hello, I think I found solution, need to go to Freestyle Line Style, then in Strokes tab, check Chaining checkbox (and select Plain, check Same Object). Now nut.blend file renders for about 2 seconds! I hope it helps
Member

@kjym3, maybe you could create some testbuilds using the experimental-build branch (instructions here )? The folks here could test this then before committing.

@kjym3, maybe you could create some testbuilds using the experimental-build branch (instructions [here ](http://lists.blender.org/pipermail/bf-committers/2014-October/044375.html))? The folks here could test this then before committing.

I think I will just commit the proposed patch to git master after I test it a bit more. Then nightly builds will soon allow testers to check if the reported slowness has been addressed.

I think I will just commit the proposed patch to git master after I test it a bit more. Then nightly builds will soon allow testers to check if the reported slowness has been addressed.
Member

I will test tomorrow unless you know what hash it has been placed into

I will test tomorrow unless you know what hash it has been placed into

The patch stroke_render_optimization.patch has been committed in Git master: d8b00a3bf5. Further performance tests would be much appreciated.

The patch [stroke_render_optimization.patch](https://archive.blender.org/developer/F133671/stroke_render_optimization.patch) has been committed in Git master: d8b00a3bf5. Further performance tests would be much appreciated.
Member

This did not work for me rendered on CPU with Ubuntu 14.04

Used blender Linux 64 bit Official blender-2.73- 8a28895 -linux-glibc211-x86_64.tar.bz2 94M Sat Jan 3 03:12:20 2015

Render time 3:15.95

Windows 8.0

I used blender version: Windows 64 bit Official blender-2.73- 8a28895 -win64.zip 100M Sat Jan 3 03:13:48 2015

Render time: 56.49

Windows 8.0 Hardware specs

Intel(R) HD Graphics 4600




Report Date:			1/2/2015
Report Time[hh:mm:ss]:		12:37:25
Driver Version:			9.18.10.3165
Operating System:		Windows 8  (6.2.9200)
Default Language:		English (United States)
Installed DirectX* Version:	11.1
Supported DirectX* Version:	11.1
Shader Version:			5.0
OpenGL* Version:			4.0
Physical Memory:		16136 MB
Processor:			Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
Processor Speed:		2394 MHz
Vendor ID:			8086
Device ID:			0416
Device Revision:		06

Ubuntu same specs but 7.5 GB of RAM (Virtual Machine)

Five and a half times slower!!!

This did not work for me rendered on CPU with Ubuntu 14.04 Used blender Linux 64 bit Official blender-2.73- 8a28895 -linux-glibc211-x86_64.tar.bz2 94M Sat Jan 3 03:12:20 2015 Render time 3:15.95 Windows 8.0 I used blender version: Windows 64 bit Official blender-2.73- 8a28895 -win64.zip 100M Sat Jan 3 03:13:48 2015 Render time: 56.49 Windows 8.0 Hardware specs ``` Intel(R) HD Graphics 4600 Report Date: 1/2/2015 Report Time[hh:mm:ss]: 12:37:25 Driver Version: 9.18.10.3165 Operating System: Windows 8 (6.2.9200) Default Language: English (United States) Installed DirectX* Version: 11.1 Supported DirectX* Version: 11.1 Shader Version: 5.0 OpenGL* Version: 4.0 Physical Memory: 16136 MB Processor: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz Processor Speed: 2394 MHz Vendor ID: 8086 Device ID: 0416 Device Revision: 06 ``` Ubuntu same specs but 7.5 GB of RAM (Virtual Machine) Five and a half times slower!!!
Member

@Blendify you cant expect a virtual machine to render as fast as a real machine... it only uses a part of the available hardware...

@Blendify you cant expect a virtual machine to render as fast as a real machine... it only uses a part of the available hardware...
Member

@JulianEisel even though it is a virtual machine it still is dramatically different from the first time I tested under the same testing environment.

First test from earlier comments

pasted_file

@JulianEisel even though it is a virtual machine it still is dramatically different from the first time I tested under the same testing environment. First test from earlier comments ![pasted_file](https://archive.blender.org/developer/F134984/pasted_file)

Please never, ever use a virtual machine for bug reports in general, and performance tests in particular. The use of a single instruction somewhere can make the whole code orders of magnitude slower than on 'native' OS - or not. In other words, performances test results from a VM are absolutely meaningless.

Please never, ever use a virtual machine for bug reports in general, and performance tests in particular. The use of a single instruction somewhere can make the whole code orders of magnitude slower than on 'native' OS - or not. In other words, performances test results from a VM are absolutely meaningless.
Member

Thanks for the feed back I would like to some day set up a split hard drive

Thanks for the feed back I would like to some day set up a split hard drive
Member

Using a VM to do performance test, the result depends on much more factors than on a real installation. Even if you think everything is the same it may not be so. So just as Bastien said, performance tests on a VM are meaningless :/

Using a VM to do performance test, the result depends on much more factors than on a real installation. Even if you think everything is the same it may not be so. So just as Bastien said, performance tests on a VM are meaningless :/

Hello, would You like to test render time of the same file (now Strokes Chaining is checked) nut-stroke.blend Now render time is about 2-3 seconds on my Debian Nvidia GeForce 9800 GT & Intel Core 2 3GHz

Hello, would You like to test render time of the same file (now Strokes Chaining is checked) [nut-stroke.blend](https://archive.blender.org/developer/F134988/nut-stroke.blend) Now render time is about 2-3 seconds on my Debian Nvidia GeForce 9800 GT & Intel Core 2 3GHz
Member

What's the latest status here? Could somebody test again so we can see if the issue has been resolved?

What's the latest status here? Could somebody test again so we can see if the issue has been resolved?

The issue has been resolved.

On my workstation, the original file of bugreport takes 20 seconds with 2.73a but only 1 s with current master 0f65250.

With nut-stroke.blend, results are 1.12 s with 2.73a and 0.85 s with current master 0f65250.

The issue has been resolved. On my workstation, the original file of bugreport takes 20 seconds with 2.73a but only 1 s with current master 0f65250. With nut-stroke.blend, results are 1.12 s with 2.73a and 0.85 s with current master 0f65250.
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

That's good news! Closing as Resolved then :)

That's good news! Closing as Resolved then :)
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
8 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#41964
No description provided.