#5 Reduce CPU/GPU usage?

Aperto
aperto 6 anni fa da TheMonsterFromTheDeep · 2 commenti

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 commented 6 anni fa
Proprietario

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 commented 6 anni fa
Proprietario

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.
Sign in to join this conversation.
Nessuna etichetta
Nessuna milestone
Nessun assegnatario
1 Partecipanti
Caricamento...
Annulla
Salva
Non ci sono ancora contenuti.