#5 Reduce CPU/GPU usage?

开启中
TheMonsterFromTheDeep6 年之前创建 · 2 条评论

Right now, glassdrop is using ~4% CPU and ~15% GPU on my computer, according to Task Manager -- compare to Windows Media Player, which uses ~0.5% and 0%. Certainly this could be slightly impacted by running it from Visual Studio, but it seems likely that there exists a problem nonetheless.

I'm not entirely sure how to reduce all of this, as I have tried simply reducing the amount of time glassdrop spends actually doing anything (see 5cc03d525a) but this doesn't seem to be enough.

I could, say, try drawing in retained mode with OpenGL, but given that the majority of the graphics are being updated every frame anyways, I imagine this would actually be slower.

I should probably look into SDL_mixer to see exactly what it is doing, as I'm pretty sure it's creating some threads that make it a little harder to reduce CPU usage.

Right now, glassdrop is using ~4% CPU and ~15% GPU on my computer, according to Task Manager -- compare to Windows Media Player, which uses ~0.5% and 0%. Certainly this could be slightly impacted by running it from Visual Studio, but it seems likely that there exists a problem nonetheless. I'm not entirely sure how to reduce all of this, as I have tried simply reducing the amount of time glassdrop spends actually doing anything (see https://notabug.org/TheMonsterFromTheDeep/glassdrop/commit/5cc03d525af1cbcbdc50f8a49082fa4042841bf4) but this doesn't seem to be enough. I could, say, try drawing in retained mode with OpenGL, but given that the majority of the graphics are being updated every frame anyways, I imagine this would actually be slower. I should probably look into SDL_mixer to see exactly what it is doing, as I'm pretty sure it's creating some threads that make it a little harder to reduce CPU usage.
TheMonsterFromTheDeep 评论于 6 年之前
所有者

It appears that with optimization turned on, glassdrop uses ~1% CPU but still ~15% GPU. :/

It appears that with optimization turned on, glassdrop uses ~1% CPU but still ~15% GPU. :/
TheMonsterFromTheDeep 评论于 6 年之前
所有者

Additional tests show that turning off MSAA reduces GPU usage by 3-5% (as measured by Task Manager), and that reducing the number of points used to render the waveform may save slightly on performance.

It also appears that using GL_LINE_STRIP instead of GL_QUAD_STRIP does not have any impact, despite requiring half as many vertices and no extra math.

At this point, I'm relatively convinced that the reading in Task Manager is not actually bad per se -- first of all, it's not measuring performance, just utilization, and likely imperfectly at that -- and it's somewhat inevitable that the graphics card will be utilized when redrawing fast enough to provide a smoothly-animated waveform.

Additional tests show that turning off MSAA reduces GPU usage by 3-5% (as measured by Task Manager), and that reducing the number of points used to render the waveform may save slightly on performance. It also appears that using GL_LINE_STRIP instead of GL_QUAD_STRIP does not have any impact, despite requiring half as many vertices and no extra math. At this point, I'm relatively convinced that the reading in Task Manager is not actually *bad* per se -- first of all, it's not measuring performance, just utilization, and likely imperfectly at that -- and it's somewhat inevitable that the graphics card will be utilized when redrawing fast enough to provide a smoothly-animated waveform.
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
1 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。