I'm trying to profile Roc to find hot spots. Claude has figured a convoluted scheme involving LIR dumps. Is there a better way?
From Claude:
On asking the Roc Zulip: yes, I think one narrow question is worth it. Even with --debug, the wasm names functions only by number (roc__proc_313), and ROC_LIR_DUMP numbers them differently. Matching the two took a hand-written decoder comparing constants. The question: "Is there a way to get source names into the wasm name section, or a map from proc id to source name, for dev-backend builds?" That's concrete and easy to answer.
I don't think there's been much wasm profiling yet, maybe @Luke Boswell has done some?
I do this trick for my WASM platforms where I also have a native "test" host, and the I can use all the standard tools. I also like to fill the native host to the gills with instrumentation and telemetry and fun things so I can dig into all the details like roc allocarions or traces.
Last updated: Sep 24 2026 at 15:59 UTC