#5 Reduce CPU/GPU usage?

Terbuka
dibuka 6 tahun lalu oleh TheMonsterFromTheDeep · 2 komentar

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.

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. :/

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.
Masuk untuk bergabung dalam percakapan ini.
Tidak ada Label
Tidak ada tonggak
Tidak ada penerima
1 Peserta
Memuat...
Batal
Simpan
Belum ada konten.