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

Examples/sdl2 improvement #14

Merged
merged 3 commits into from
May 10, 2020
Merged

Examples/sdl2 improvement #14

merged 3 commits into from
May 10, 2020

Conversation

hakobera
Copy link
Owner

  • SDL の Main Loop に Sleep を仕込むことで、CPU利用率を低減する
  • YUV -> RGBA の変換を SDL 内部で実行してもらう。SDL 内部では SSE や GPU の支援をうけられるような実装になっているので、ソフトウェア処理より早い
  • SDL Window に描画時のスケーリング処理を SDL 側に移譲した。こちらも最適化がされているので、go で実装するより速い

結果として、CPU利用率が 110% -> 15% (ThinkPad E495 Ryzen 5 で計測時) にまで低減された。

@hakobera hakobera merged commit d7c4598 into master May 10, 2020
@hakobera hakobera deleted the examples/sdl2-improvement branch May 10, 2020 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant