Skip to content

Only call glFlush/glFinish if telemetry is enabled (fixes #275)#1043

Merged
not-fl3 merged 1 commit into
not-fl3:masterfrom
jmmut:master
Jun 1, 2026
Merged

Only call glFlush/glFinish if telemetry is enabled (fixes #275)#1043
not-fl3 merged 1 commit into
not-fl3:masterfrom
jmmut:master

Conversation

@jmmut

@jmmut jmmut commented May 31, 2026

Copy link
Copy Markdown
Contributor

See #275

I also have linux with nvidia and for all macroquad programs I get ~96% CPU unless I put sleeps (which shouldn't be done inside async).

After the research done by the people in the issue and me, it seems to me that glFinish is not really needed, so this PR only keeps it if telemetry is enabled. I also made a getter for telemetry::is_enabled().

Here is a CPU usage comparison of the "basic_shapes" example:

mq_glfinish_ed9cdbd_before
mq_glfinish_dce417a_after

I also tried this in wasm for my game and it seems to work with lowish CPU, but I didn't make a comparison so I don't know if before it was the same or higher.


Let me know if you want different format or different comments. Also it's ok if you don't want to merge, I did my own fork to try out other stuff.

@not-fl3

not-fl3 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Thanks for PR!

@not-fl3 not-fl3 merged commit dd57be6 into not-fl3:master Jun 1, 2026
5 of 6 checks passed
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.

2 participants