
that’s really cool @soegaard2

I took it as a joke, and responded jokingly (I hope).

Are there any ‘Developer Evangelist’ on the plane? or does anyone know one who might be up for providing a little advice? (Basically I’d like to take up a half hour of the time of someone who knows what they are doing to see if there is anything we can do better)

What causes ???
records in profiles? When do we have stack frames without corresponding stack locations?

If I have a named let
, but it does not actually call itself recursively, does it create a stack frame on its first execution?

Basically, I have an imperative function with three phases. I want all three to appear separately in profiling results. Of course I can do that by defining three different functions, but that would be kind-of inconvenient.

I’m now pretty convinced that these are for loops. It would be really swell to get at least source locations on these, and ideally label them something like for
or even (for (,args) …)
so I can identify which for loop it is.

But even just source locations would be swell, because it would mean that each for loop has its own profile entry. Whereas right now there’s a profile entry for “all for loops”, which naturally is not super helpful.

I think ??? will only happen if the relevant function has no name or source location at all, which is unlikely to be the case for a normal let loop or for

A named let certainly involves a function call even if there’s no recursive call

Whether there’s a stack frame is a more complicated question that can depend on inlining or tail calls

Hmm. let loop
definitely produces names, but for loops do not for me. It might be my profile->json
code, I’ll double-check…

The “name” is probably just a source location

Hmm. Is there a way to disable inlining? I already understand the tail call issue. It is going to mess up my profiles but I can account for that.

There is an environment variable and a flag to raco make

You can see some raw info by calling continuation-mark-set->context inside the function and printing that

Ah. Is there a way to disable inlining for a specific function? Or can I force a new stack frame into existence by calling call-with-immediate-continuation-mark
?

You can’t explicitly disable inlining for a function, but if you mutate the function (eg (set! f f)) then it won’t inline

love it, love it, thank you Sam.

Someone should figure out a good debuginfo story for this sometime