Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: impl IdlingRenderScheduler #10547

Merged
merged 18 commits into from
May 19, 2023
Merged

feat: impl IdlingRenderScheduler #10547

merged 18 commits into from
May 19, 2023

Conversation

acid-chicken
Copy link
Member

What

より高精度で負荷のかかりづらいレンダリングスケジューラを作る

Why

Close #10510

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Apr 9, 2023
@github-actions github-actions bot requested a review from syuilo April 9, 2023 05:11
@codecov
Copy link

codecov bot commented Apr 9, 2023

Codecov Report

Merging #10547 (177afa4) into develop (55c10d0) will decrease coverage by 16.38%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           develop   #10547       +/-   ##
============================================
- Coverage    94.71%   78.34%   -16.38%     
============================================
  Files            2      164      +162     
  Lines          454    20448    +19994     
  Branches        59      363      +304     
============================================
+ Hits           430    16019    +15589     
- Misses          24     4429     +4405     
Impacted Files Coverage Δ
packages/frontend/src/components/global/MkTime.vue 87.69% <ø> (ø)

... and 161 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@acid-chicken
Copy link
Member Author

名前がよくないかも(render する renderer をスケジューリングしているのは render ではなさそう)

@acid-chicken acid-chicken changed the title feat: impl IdleRender feat: impl IdlingRenderScheduler Apr 9, 2023
packages/frontend/src/scripts/idle-render.ts Outdated Show resolved Hide resolved
packages/frontend/src/scripts/idle-render.ts Outdated Show resolved Hide resolved
packages/frontend/src/scripts/idle-render.ts Outdated Show resolved Hide resolved
}
});
});
}, { once: true });
} else {
sAngle = Math.PI * s / 30;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ、Math.PI * (now.valueOf() / 1000) / 30にしちゃえばdisableSAnimateする必要もなくなりそうです

(時間がoverflowすることはないので)

Copy link
Member Author

@acid-chicken acid-chicken Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大きすぎて浮動小数点数精度が足りてなさそう

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

戻した

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Math.PI * Math.floor(new Date().valueOf() / 1000) / 30176075836.15642264辺りでそんなに大きくないので謎

Copy link
Member Author

@acid-chicken acid-chicken Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もしブラウザが内部でラジアンを f32 で扱っていたら 176075836.15642264 から 0.01745329251 (1deg) を引いてもメモリ表現は 0x4d27eb44 から変わらないので、精度が足りていない可能性はやはりありそう

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに!

そこを% (60 * 60 * 24 * 365) とかでどうにかしてもようさそうです(年に一度たけおかしくはなりますが)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Servo は f32 だった image

Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

実際性能に影響がどんなにあるのかはわかりませんが問題はなさそうです

}
});
});
}, { once: true });
} else {
sAngle = Math.PI * s / 30;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに!

そこを% (60 * 60 * 24 * 365) とかでどうにかしてもようさそうです(年に一度たけおかしくはなりますが)

@syuilo syuilo merged commit ee3f408 into develop May 19, 2023
@syuilo syuilo deleted the feat/idle-render branch May 19, 2023 18:38
@syuilo
Copy link
Member

syuilo commented May 19, 2023

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

タイムセンシティブなコンポーネントの正確な描画
3 participants