Stream: performance

Topic: How to use Tracy to profile the execution of a roc program?


view this post on Zulip Matthieu Pizenberg (Dec 15 2025 at 17:20):

I’ve managed to install tracy, build it from source, and have the tracy GUI up.
Then I’m compiling the roc binary with:

zig build roc -Dtracy=/Users/piz/git/wolfpld/tracy -Dtracy-callstack=true

And then when I’m running the roc program, it seems to connect to the tracy server. And then I have the following catpure.

image.png

It basically says that all the time is spent inside rocRun. If I want to get more fine-grained insight, what should I do?

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:24):

Weird. I wonder why it didn't expand all the zones for you. (zooming out may fix?)

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:25):

Do you have any ability to drag down and expand the main thread zone to see more?

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:26):

Also, if you sort by self time in that zone info panel, you probably still would get a solid sense of where is best to look at. Though it is possible that we don't yet have tracing for whichever functions are slow in this case.

Generally, I use roc build and then run the app separately so that compilation time and run time are separate traces

view this post on Zulip Matthieu Pizenberg (Dec 15 2025 at 17:28):

I don’t think I have access to any more details. Though when I added manually the two lines at the top of rocRun to the top of runWithPosixFdInheritance, I see it in the details.
image.png
But you are probably right, I might need to split into build an executable then run that

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:31):

What really odd is that clearly it is recording more data

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:31):

Otherwise it wouldn't know all of those sell times below

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:31):

I'm guess we don't have coverage for whatever is eating all the time

view this post on Zulip Brendan Hansknecht (Dec 15 2025 at 17:32):

Is this from your append benchmark?

view this post on Zulip Matthieu Pizenberg (Dec 15 2025 at 17:32):

Got more by running the binary directly :)
image.png

view this post on Zulip Matthieu Pizenberg (Dec 15 2025 at 17:33):

Thx

view this post on Zulip Matthieu Pizenberg (Dec 15 2025 at 19:38):

I wrote a bit about what I tried here. Might continue on it in the coming days, but feel free to steal anything interesting in there to incorporate in other perf PRs.
https://github.com/roc-lang/roc/pull/8687


Last updated: Dec 21 2025 at 12:15 UTC