Viewport has 8fps if i open Animation viewports. #40372

Closed
opened 2014-05-26 22:13:48 +02:00 by paul geraskin · 15 comments
Member

System Information
Linux 64,

Blender Version
2.70.5 nightly build.

Short description of error
I get 8 fps if i do like this: http://youtu.be/yJcMInvQ1jU

Here is test file https://developer.blender.org/F124318

Exact steps for others to reproduce the error

**System Information** Linux 64, **Blender Version** 2.70.5 nightly build. **Short description of error** I get 8 fps if i do like this: http://youtu.be/yJcMInvQ1jU Here is test file https://developer.blender.org/F124318 **Exact steps for others to reproduce the error**
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @PaulGeraskin

Added subscriber: @PaulGeraskin
Joshua Leung was assigned by Campbell Barton 2014-05-27 03:30:53 +02:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Not sure I'd consider this a bug, but functions findzero and berekeny are quite heavy here.

Its calling fcurve_eval_keyframes a lot

Attached a patch which skips complex handle calculation when there is no need. but its not really solving the problem, just a small workaround.

fcurve_skip_findzero.diff

Other possible speedups.

  • Cache result of binarysearch_bezt_index_ex, so drawing (or any other caller), which does ordered lookups can avoid doing a full binary search each time.
  • Store per-space draw-cache for evaluated fcurves, this way redraws and playback would be fast, however transforming all curves or panning would remain slow.
  • Have a maximum number of steps to show, (rather then pixels), perhaps one sample per frame (probably OK for beziers, not so nice for some easing options).
  • Use a 2D array and have a function to fill in the points, take advantage of the ability to cache lookups.
Not sure I'd consider this a bug, but functions `findzero` and `berekeny` are quite heavy here. Its calling `fcurve_eval_keyframes` a *lot* Attached a patch which skips complex handle calculation when there is no need. but its not really solving the problem, just a small workaround. [fcurve_skip_findzero.diff](https://archive.blender.org/developer/F91346/fcurve_skip_findzero.diff) Other possible speedups. * Cache result of `binarysearch_bezt_index_ex`, so drawing (or any other caller), which does ordered lookups can avoid doing a full binary search each time. * Store per-space draw-cache for evaluated fcurves, this way redraws and playback would be fast, however transforming all curves or panning would remain slow. * Have a maximum number of steps to show, (rather then pixels), perhaps one sample per frame (probably OK for beziers, not so nice for some easing options). * Use a 2D array and have a function to fill in the points, take advantage of the ability to cache lookups.
Member

Added subscriber: @totoro-4

Added subscriber: @totoro-4
Member

Perhaps it redraws the whole view in every frame step? It requires 25 redraws/sec... For panning, zooming, modifying the curves etc. maybe a lower rate is quite enough. Maybe you can speed up the playback also if you redraw only the changed part at the cursor (if possible).

Perhaps it redraws the whole view in every frame step? It requires 25 redraws/sec... For panning, zooming, modifying the curves etc. maybe a lower rate is quite enough. Maybe you can speed up the playback also if you redraw only the changed part at the cursor (if possible).
Member

Added subscriber: @LukasTonne

Added subscriber: @LukasTonne
Member

I noticed that the fps issue becomes a lot worse for small x-axis intervals (zooming in on frames) - which seems odd given that this would contain a lot less frames and thus should require fewer fcurve evals. Zooming out OTOH gives fluid framerates.

I noticed that the fps issue becomes a lot worse for small x-axis intervals (zooming in on frames) - which seems odd given that this would contain a lot less frames and thus should require fewer fcurve evals. Zooming out OTOH gives fluid framerates.
Member

@LukasTonne:
The reason is that when zoomed in, it needs to sample the curve many more times to fill the gaps between keyframes, while when zoomed out, we can just plot the keyframes and be done.

As for fixing this, I'm currently leaning towards the following option:
For the majority of cases, it would be nice to move back to using the old sample-free code for the segments where actually sampling isn't necessary. That should resolve the performance problems for most users most of the time that this generally isn't a big issue. Sure, the issues still exist when dealing with fancy curves, but at least in the foreseeable future, these won't be such a big deal yet.

I'm personally not fond of using any form of caches anywhere - at least until we've completely and thoroughly exhausted every other alternative. They are a pain to get working seamlessly - our buggered pointcaches are one of the many examples of how this can go so wrong.

@LukasTonne: The reason is that when zoomed in, it needs to sample the curve many more times to fill the gaps between keyframes, while when zoomed out, we can just plot the keyframes and be done. As for fixing this, I'm currently leaning towards the following option: For the majority of cases, it would be nice to move back to using the old sample-free code for the segments where actually sampling isn't necessary. That should resolve the performance problems for most users most of the time that this generally isn't a big issue. Sure, the issues still exist when dealing with fancy curves, but at least in the foreseeable future, these won't be such a big deal yet. I'm personally not fond of using any form of caches anywhere - at least until we've completely and thoroughly exhausted every other alternative. They are a pain to get working seamlessly - our buggered pointcaches are one of the many examples of how this can go so wrong.
Member

Also, maybe if you zoom out it is not necessary to refresh at each frames, only when the cursor really moves (when 1 pixel > 1 frame)

Also, maybe if you zoom out it is not necessary to refresh at each frames, only when the cursor really moves (when 1 pixel > 1 frame)

This issue was referenced by f0a2e714b3

This issue was referenced by f0a2e714b3c0149c02014d2735e713b9b1b81eff
Member

Changed status from 'Open' to: 'Resolved'

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

Closed by commit f0a2e714b3.

Closed by commit f0a2e714b3.
Author
Member

Thanks!

Thanks!
Author
Member

character_test_fps.blend

I removed the file from the dropbox. i attached here it for any cases.

[character_test_fps.blend](https://archive.blender.org/developer/F124318/character_test_fps.blend) I removed the file from the dropbox. i attached here it for any cases.
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
6 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#40372
No description provided.