Edit-Mesh Performance Overview #88021

Open
opened 2021-05-04 10:57:08 +02:00 by Campbell Barton · 14 comments

Motivation:

This tasks is an summarizes where time is being spent when updating a mesh, to help us focus on areas that should be optimized.

Benchmark Method:

These tests were made by timing how fast a mesh updates while transforming a single vertex of a high poly mesh.
while the exact results will differ compared to animation playback or modifier stack evaluation.
Transforming a smaller part of a larger mesh is a common enough use case that performance issues cover many other kinds of updates too.

This test was performed on the spring character, joined into a single mesh and copied 10x times (to reduce performance for measurable results).
as well as a subdivided cube (1.5m quads).

Details:

  • Tested on a release build on Linux (with some modifications for testing).

  • The CPU profile set to performance to avoid unpredictable results.

  • Each test disables updating some kind of data:

    • use_mesh_no_tess_calc Don't recalculate tessellation/triangulating.
    • use_mesh_no_normal_calc Don't recalculate normals.
    • use_mesh_no_transform_update Don't update copy-on-write mesh data during transform.
    • use_mesh_no_draw Skip mesh conversion and uploading to the GPU, don't populate the draw manager.
  • Disabling all options is also tested to ensure there isn't any significant overhead in this case

(it's clamped to 60hz on my system).

Results:

In the test results the time to update a mesh is divided between the following operations.

  • ~9-14% use_mesh_no_tess_calc
  • ~10-15% use_mesh_no_normal_calc
  • ~15-40% use_mesh_no_transform_update
  • ~30-50% use_mesh_no_draw

Conclusions:

  • The two main bottlenecks are uploading data to the GPU and copy-on write updated in edit-mode.
  • Optimizing mesh conversion is a large project which needs further investigation & testing, see #87835 (GPU: Mesh Drawing Performance)
  • Copy-on-write updates in edit-mode is redundant and as far as I can see, should be skipped entirely.
  • While tessellation & normal calculation could be optimized, this doesn't seem high priority,
these areas could be improved once the main bottlenecks are resolved.

Notes:

  • A different set of files could give fairly different results
(an architectural file with many N-gons will show tessellation as taking more time for e.g).
These tests are to prioritize optimizing a common case,
there is of course room for optimizing more specialized cases.
  • The test files should be made publicly available, and could be expanded on.
**Motivation:** This tasks is an summarizes where time is being spent when updating a mesh, to help us focus on areas that should be optimized. **Benchmark Method:** These tests were made by timing how fast a mesh updates while transforming a single vertex of a high poly mesh. while the exact results will differ compared to animation playback or modifier stack evaluation. Transforming a smaller part of a larger mesh is a common enough use case that performance issues cover many other kinds of updates too. This test was performed on the spring character, joined into a single mesh and copied 10x times (to reduce performance for measurable results). as well as a subdivided cube (1.5m quads). - The results are here: [P2102](https://archive.blender.org/developer/P2102.txt) - The branch used for testing: blender/blender-staging@2e4e3adb3e **Details:** - Tested on a release build on Linux (with some modifications for testing). - The CPU profile set to `performance` to avoid unpredictable results. - Each test disables updating some kind of data: - `use_mesh_no_tess_calc` Don't recalculate tessellation/triangulating. - `use_mesh_no_normal_calc` Don't recalculate normals. - `use_mesh_no_transform_update` Don't update copy-on-write mesh data during transform. - `use_mesh_no_draw` Skip mesh conversion and uploading to the GPU, don't populate the draw manager. - Disabling all options is also tested to ensure there isn't any significant overhead in this case ``` (it's clamped to 60hz on my system). ``` **Results:** In the test results the time to update a mesh is divided between the following operations. - ~9-14% `use_mesh_no_tess_calc` - ~10-15% `use_mesh_no_normal_calc` - ~15-40% `use_mesh_no_transform_update` - ~30-50% `use_mesh_no_draw` **Conclusions:** - The two main bottlenecks are uploading data to the GPU and copy-on write updated in edit-mode. - Optimizing mesh conversion is a large project which needs further investigation & testing, see #87835 (GPU: Mesh Drawing Performance) - Copy-on-write updates in edit-mode is redundant and as far as I can see, should be skipped entirely. - While tessellation & normal calculation could be optimized, this doesn't seem high priority, ``` these areas could be improved once the main bottlenecks are resolved. ``` **Notes:** - A different set of files could give fairly different results ``` (an architectural file with many N-gons will show tessellation as taking more time for e.g). ``` ``` These tests are to prioritize optimizing a common case, there is of course room for optimizing more specialized cases. ``` - The test files should be made publicly available, and could be expanded on.
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly

Added subscriber: @kioku

Added subscriber: @kioku

Added subscriber: @TheRedWaxPolice

Added subscriber: @TheRedWaxPolice

Added subscriber: @Hologram

Added subscriber: @Hologram

Added subscriber: @machieb

Added subscriber: @machieb

Hello, I don´t know if this is the right place for my statement but blender is massivly slow when trying to select an object in the viewport.
The more objects are in the scene and the more poligons they have it gets slower and slower. Our typical scenes have >10000 objects and >20million polygons. That is not extreme.
We use a very old 3D-program that was not updated since 2012 to select and shade all our objects in the scene, because in Blender it is not possible. In Blender you wait 5-10sec after clicking on an object in the viewport until it gets selected.
In the other packages selection is instantly. This Program can handle more than 100million polygons and instant selection with ease.
I hope this behavior could be solved when you now try to improve the edit-mesh performance!
Thanks

Hello, I don´t know if this is the right place for my statement but blender is massivly slow when trying to select an object in the viewport. The more objects are in the scene and the more poligons they have it gets slower and slower. Our typical scenes have >10000 objects and >20million polygons. That is not extreme. We use a very old 3D-program that was not updated since 2012 to select and shade all our objects in the scene, because in Blender it is not possible. In Blender you wait 5-10sec after clicking on an object in the viewport until it gets selected. In the other packages selection is instantly. This Program can handle more than 100million polygons and instant selection with ease. I hope this behavior could be solved when you now try to improve the edit-mesh performance! Thanks

Added subscriber: @ArtemBataev

Added subscriber: @ArtemBataev
Author
Owner

In #88021#1158744, @machieb wrote:
Hello, I don´t know if this is the right place for my statement but blender is massivly slow when trying to select an object in the viewport.

Object mode selection isn't closely related to edit-mesh performance.

> In #88021#1158744, @machieb wrote: > Hello, I don´t know if this is the right place for my statement but blender is massivly slow when trying to select an object in the viewport. Object mode selection isn't closely related to edit-mesh performance.
Contributor

Added subscriber: @RedMser

Added subscriber: @RedMser

Added subscriber: @PetterLundh

Added subscriber: @PetterLundh

Added subscriber: @ckohl_art

Added subscriber: @ckohl_art
Philipp Oeser removed the
Interest
Modeling
label 2023-02-09 15:28:33 +01:00
Sign in to join this conversation.
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
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
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
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
11 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#88021
No description provided.