Lua runs every vsync while the window has focus, even when idle
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- desktop, performance
調査の方向性
Start with the main loop in engine/system/win/sys_main.cpp, ui_main_c::Frame in ui_main.cpp, and frame elision in engine/render/r_main.cpp; then trace GLFW callbacks and texture worker handoffs in engine/system/win/sys_video.cpp and engine/render/r_texture.cpp. Check how #110's condition variable change works and how Lua-driven caret blinking, toasts, and jewel animations request regular frames. Done means idle focused windows avoid running Lua and swapping at every vsync while inputs, worker results, and animations still update.
索引モデルが issue の本文から書いたものです。
説明
While PoB has focus, OnFrame runs every vsync even when nothing changes. The main loop only waits when minimized (https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/engine/system/win/sys_main.cpp#L697-L704), and ui_main_c::Frame only sleeps when the window is unfocused (https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/ui_main.cpp#L389-L391 and https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/ui_main.cpp#L435-L437). Frame elision skips drawing the layers (https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/engine/render/r_main.cpp#L1209-L1240), but Lua, the blit and the swap still run every frame. On a 144 Hz screen that's 144 Lua frames a second for an idle window.
I know running Lua only when something happens is on your list. These are the places I think it would touch:
- The elision hash could double as an idle detector. After a few identical frames with no input, no subscript, no running coroutine and no pending texture, the loop could switch from
glfwPollEventstoglfwWaitEventsTimeout. - The GLFW callbacks would set a dirty flag. The cursor callback already stores the position (https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/engine/system/win/sys_video.cpp#L487-L494).
- Workers would call
glfwPostEmptyEvent()when they hand something to the main thread: subscript messages, and texture uploads (https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/engine/render/r_texture.cpp#L184-L188). - The texture workers spin on
Sleep(1)while idle (https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/blob/421d18871cccb2696b5a57e6d72a9fc22fa641ae/engine/render/r_texture.cpp#L229). The condvar change from #110 (6a74097) already fixes that.
On the PoB side the caret blink, toasts and the rotating jewel rings need regular frames, so a timeout of a few hundred ms, or a way for Lua to ask for the next frame, would keep those working.
- 主要言語
- C++
- スター
- 23
- フォーク
- 69
- 平均マージ
- 2時間 50分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
難易度 4/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic の issue をすべて見る
似ている issue
-
enhancement help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
difficulty:easy prio:normal type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NatronGitHub/openfx-supportext#326 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
zucch1/android-auto-jetson#293 ·
メンテナーはふだん 1 日以内に返信
-
lfortran -E exits with status 0 after a C preprocessor error (#error, wrong macro argument count)オープンbug low priority preprocessor
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
difficulty:easy enhancement prio:low
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NatronGitHub/openfx-misc#502 ·
メンテナーはふだん 1 日以内に返信