VSE: make Wipe effect 6x-20x faster #115837

Merged
Aras Pranckevicius merged 2 commits from aras_p/blender:vse-wipe-opt into main 2023-12-06 19:43:08 +01:00

Wipe effect was completely single threaded. So multi-thread that. Additionally, simplify math done in Clock wipe code; asin() + hypot() + some checks is just atan2() really.

Applying Wipe to 4K UHD sequencer output, on Windows Ryzen 5950X:

  • Single/Double: 99.1 -> 9.3 ms (10.6x faster)
  • Iris: 153.3 -> 12.3 ms (12.4x faster)
  • Clock: 301.4 -> 14.5 ms (20.8x faster)

The same on Mac M1 Max:

  • Single: 74.5 -> 13.4 ms (5.6x faster)
  • Iris: 84.2 -> 14.3 ms (5.9x faster)
  • Clock: 185.3 -> 18.8 ms (9.8x faster)
Wipe effect was completely single threaded. So multi-thread that. Additionally, simplify math done in Clock wipe code; `asin()` + `hypot()` + some checks is just `atan2()` really. Applying Wipe to 4K UHD sequencer output, on Windows Ryzen 5950X: - Single/Double: 99.1 -> 9.3 ms (10.6x faster) - Iris: 153.3 -> 12.3 ms (12.4x faster) - Clock: 301.4 -> 14.5 ms (20.8x faster) The same on Mac M1 Max: - Single: 74.5 -> 13.4 ms (5.6x faster) - Iris: 84.2 -> 14.3 ms (5.9x faster) - Clock: 185.3 -> 18.8 ms (9.8x faster)
Aras Pranckevicius added 2 commits 2023-12-06 12:45:01 +01:00
a7c815d5e7 VSE: speedup Wipe effect by multithreading
4K UHD resolution, Windows Ryzen 5950X, applying wipe:
- Single 99.8 -> 9.3 ms
- Double 98.1 -> 9.3 ms
- Iris 153.3 -> 12.3 ms
- Clock 301.4 -> 21.1 ms
buildbot/vexp-code-patch-coordinator Build done. Details
33e73ad398
VSE: speedup Wipe Clock by simplifying math
asin(y/hypot(x,y)) plus a bunch of quadrant checks is just atan2. So do
that instead.

4K UHD resolution, Windows Ryzen 5950X, clock wipe: 21.1 -> 14.5ms
Aras Pranckevicius changed title from WIP: VSE: make Wipe effect 10x-20x faster to WIP: VSE: make Wipe effect 6x-20x faster 2023-12-06 12:54:11 +01:00
Author
Member

@blender-bot build

@blender-bot build
Aras Pranckevicius added this to the Video Sequencer project 2023-12-06 12:54:54 +01:00
Aras Pranckevicius changed title from WIP: VSE: make Wipe effect 6x-20x faster to VSE: make Wipe effect 6x-20x faster 2023-12-06 13:47:07 +01:00
Aras Pranckevicius requested review from Richard Antalik 2023-12-06 13:47:21 +01:00
Richard Antalik approved these changes 2023-12-06 18:33:46 +01:00
Richard Antalik left a comment
Member

For patch I don't think I have any objections.
Just wanted to comment, that reading the code does hurt a little bit. So thanks for enduring that :)

For patch I don't think I have any objections. Just wanted to comment, that reading the code does hurt a little bit. So thanks for enduring that :)
Author
Member

Just wanted to comment, that reading the code does hurt a little bit. So thanks for enduring that :)

Hah yeah in wipe code specifically there's a lot of float temp1, temp2, temp3, temp4 variables all with wildly different meanings, because why would you name them after something they are when you can just do tempN, right :) A cleanup for some other day!

> Just wanted to comment, that reading the code does hurt a little bit. So thanks for enduring that :) Hah yeah in wipe code specifically there's a lot of `float temp1, temp2, temp3, temp4` variables all with wildly different meanings, because why would you name them after something they are when you can just do tempN, right :) A cleanup for some other day!
Aras Pranckevicius merged commit 06370b5fd6 into main 2023-12-06 19:43:08 +01:00
Aras Pranckevicius deleted branch vse-wipe-opt 2023-12-06 19:43:10 +01:00
Sign in to join this conversation.
No reviewers
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 Assignees
2 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#115837
No description provided.