OpenTimelineIO / OpenTimelineIO/raven
Performance + power consumption issue on WASM build
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 140
- Forks
- 28
- Avg merge
- 14h 1m
- Merged PRs (30d)
- 2
Description
(Update: this was fixed on Linux and Mac in #99, and Windows in #102, but still needs to be addressed on the Emscripten/WASM build)
Raven naively uses Dear ImGui in a way that re-renders the window even when not needed. The application's performance & power consumption could be improved by fixing this oversight.
When I initially wrote Raven, this continuous rendering was problematic, and I attempted to use a branches of ImGui with support for ImGuiConfigFlags_EnablePowerSavingMode (see POWER_SAVING in the code). If I recall correctly Raven's WASM/Emscripten build suffered from this issue quite badly, and I was disappointed to see that the power saving mode didn't work in the browser environment due to specifics of how Emscripten works.
At the time, I set that aside for "later" figuring that Dear ImGui would improve and Raven's energy usage would improve by virtue of that change. As of this writing, that feature has not landed in ImGui.
Today (Feb 2024) I was curious to measure Raven's performance on macOS. A quick look at Raven in Activity Monitor shows that this is not a problem. The app consumes 0% CPU when it is not active, or when the user's cursor is not moving, and only about 10% when the user actively zooms/pans. I'm not entirely sure why or how that changed, so some investigation should be done. Also we should compare on other platforms (Windows, Linux) to see if those have also improved.
I also found that ocornut, Dear ImGui's author, has written this advice on the subject which looks pretty straight forward to implement, and which proposes a solution for the Emscripten scenario: https://github.com/ocornut/imgui/wiki/Implementing-Power-Save,-aka-Idling-outside-of-ImGui
So this issue is here to ask for help with the following:
- Measure Raven's CPU usage when active vs inactive on these platforms:
- Windows
- Linux
- Emscripten
- If those are problematic, then attempt to implement the strategy outlined in the linked wiki page above.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by measuring Raven's CPU usage while active and idle on Windows, Linux, and the Emscripten/WASM build, noting that Linux and Mac were reportedly fixed in #99 and Windows in #102. Review the existing POWER_SAVING code and the linked Dear ImGui power-saving guidance. Done means confirming whether WASM remains problematic and, if so, implementing and validating the proposed idle-rendering strategy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- desktop, performance, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100