Skip to content

Add basic coz integration - #3498

Open
bluesillybeard wants to merge 4 commits into
PixelGuys:masterfrom
bluesillybeard:coz-integration
Open

Add basic coz integration#3498
bluesillybeard wants to merge 4 commits into
PixelGuys:masterfrom
bluesillybeard:coz-integration

Conversation

@bluesillybeard

Copy link
Copy Markdown

In case you aren't aware, Coz is a native profiling tool. Coz has a number of benefits over a traditional profiler, you can look for those elsewhere, such as their github page: link.

In the end, Coz will generate some graphics that look like this, which relate the speedup of a line of code with relation to how it should speed up progress points (such as the frame time measured by mainLoop or how quickly chunk meshes are generated:
image

This PR was created mainly just "for fun", I wanted to see how easy / difficult it would be to integrate Coz into an existing project written in Zig. In total it took me about 5 hours. Most of that time spent looking into how Coz works under-the-hood, and much of the time was 'wasted' waiting for Coz to collect data only to later realize it wasn't working.

If you want to try this out, make sure to install Coz from their releases page or by building it from source. The version of Coz packaged by your OS may or may not be up to date. Coz only supports Linux and MacOS, and this particular integration only supports Linux.

This is not complete per se, but I figured I would submit a PR regardless, in the event anyone is interested.

@bluesillybeard
bluesillybeard marked this pull request as ready for review August 7, 2026 23:55
@bluesillybeard

Copy link
Copy Markdown
Author

aw dang, CI failed. I'll look into this at a later time/date.

@IntegratedQuantum

Copy link
Copy Markdown
Member

Oh yeah, I remember seeing the talk about this.
However I'm not sure if it's actually that useful in practice. Did you manage to actually get any interesting results here? To be honest I'm having a hard time interpreting the graphs you have posted, and I do not see any that is actually referencing code from Cubyz.

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